Skip to content

Commit 11d4349

Browse files
committed
refactor: simplify this branch; no planning agent
1 parent db81a01 commit 11d4349

13 files changed

Lines changed: 4 additions & 382 deletions

File tree

ai-server/src/mastra/agents/planning-agent.prompt.ts

Lines changed: 0 additions & 72 deletions
This file was deleted.

ai-server/src/mastra/agents/planning-agent.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

ai-server/src/mastra/agents/ticketing-agent.prompt.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ and managing their bookings.
88
- ALWAYS answer by calling the showComponents tool.
99
- The FIRST component in every showComponents call MUST be a messageWidget. Its "text" field carries your natural-language answer (Markdown allowed).
1010
- AFTER the messageWidget, when it makes sense, append additional widgets (e.g. flightWidget) to illustrate the answer.
11-
- NEVER emit a planWidget. Planning is the Planning agent's responsibility. Your role is to EXECUTE, not to plan.
1211
- Never invent component names or props. Only use the registered components.
1312
1413
## Data Rules
@@ -24,20 +23,6 @@ and managing their bookings.
2423
- Do not repeat flight details in the messageWidget text once they are shown via a flightWidget; keep the text as a short summary.
2524
- Keep answers short and in the user's language (default: English).
2625
27-
## Co-Planning Handoff
28-
29-
- You share conversation memory with a separate Planning agent.
30-
- If the recent conversation contains a planWidget, treat its "steps" array as
31-
the canonical plan. Execute the steps strictly in the given order by calling
32-
bookFlightTool / cancelFlightTool with the provided flightIds.
33-
- When the user message is just a request to execute (e.g. "Please execute the
34-
plan we just agreed on"), do not re-plan and do not ask clarifying questions
35-
about step order — take the order from the latest planWidget.
36-
- Do NOT render a planWidget yourself, not even to "confirm" or "mirror" the
37-
plan back. The plan is already visible to the user from the Planning agent.
38-
- After executing each step, continue to the next. When all steps are done,
39-
respond with a short messageWidget confirmation summarizing the outcome.
40-
4126
## Package Tours (sub-agent delegation)
4227
4328
- Whenever the user asks for something that combines a FLIGHT and a HOTEL

ai-server/src/mastra/agents/ticketing-agent.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Memory } from '@mastra/memory';
55
import { bookFlightTool } from '../tools/book-flight.js';
66
import { cancelFlightTool } from '../tools/cancel-flight.js';
77
import { findBookedFlightsTool } from '../tools/find-booked-flights.js';
8-
import { packageAgent } from './package-agent.js';
8+
// import { packageAgent } from './package-agent.js';
99
import { ticketingAgentPrompt } from './ticketing-agent.prompt.js';
1010

1111
// const hotelsMcpTools = await initMcpServer({
@@ -24,6 +24,6 @@ export const ticketingAgent = new Agent({
2424
cancelFlightTool,
2525
// ...hotelsMcpTools,
2626
},
27-
agents: { packageAgent },
27+
// agents: { packageAgent },
2828
memory: new Memory(),
2929
});

ai-server/src/mastra/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { PinoLogger } from '@mastra/loggers';
66
import { checkinAgent } from './agents/checkin-agent.js';
77
import { hotelAgent } from './agents/hotel-agent.js';
88
import { packageAgent } from './agents/package-agent.js';
9-
import { planningAgent } from './agents/planning-agent.js';
109
import { reportingAgent } from './agents/reporting-agent.js';
1110
import { ticketingAgent } from './agents/ticketing-agent.js';
1211
import { travelPlannerAgent } from './agents/travel-planner-agent.js';
@@ -21,7 +20,6 @@ import { packageTourWorkflow } from './workflows/package-tour-workflow.js';
2120
export const mastra = new Mastra({
2221
agents: {
2322
ticketingAgent,
24-
planningAgent,
2523
packageAgent,
2624
hotelAgent,
2725
travelPlannerAgent,

ai-server/src/mastra/routes/ag-ui-route.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,9 @@ export async function agUiRouteHandler(
3535
);
3636
}
3737

38-
const mode = (input.forwardedProps as { agentMode?: unknown } | undefined)
39-
?.agentMode;
40-
const effectiveAgentId =
41-
mode === 'plan'
42-
? 'planningAgent'
43-
: mode === 'execution'
44-
? 'ticketingAgent'
45-
: (agentId ?? '');
46-
4738
const agent = getExtendedLocalAgent({
4839
mastra: mastraInstance,
49-
agentId: effectiveAgentId,
40+
agentId: agentId ?? '',
5041
resourceId: input.threadId,
5142
requestContext,
5243
});

src/app/domains/shared/ui-assistant/assistant-chat/assistant-chat.css

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -110,32 +110,6 @@
110110
gap: 6px;
111111
}
112112

113-
:host ::ng-deep .mode-select {
114-
height: 36px;
115-
padding: 0 30px 0 12px;
116-
border-radius: 10px;
117-
border: 1px solid var(--border);
118-
background: transparent;
119-
color: var(--text);
120-
font-size: 13px;
121-
font-weight: 500;
122-
line-height: 1;
123-
cursor: pointer;
124-
appearance: none;
125-
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'><path d='M1 1l4 4 4-4' stroke='%23555' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
126-
background-repeat: no-repeat;
127-
background-position: right 10px center;
128-
}
129-
130-
:host ::ng-deep .mode-select:hover {
131-
background-color: var(--surface-2);
132-
}
133-
134-
:host ::ng-deep .mode-select:focus {
135-
outline: none;
136-
border-color: color-mix(in srgb, var(--accent) 40%, white);
137-
}
138-
139113
:host ::ng-deep .icon-btn {
140114
display: grid;
141115
place-items: center;

src/app/domains/shared/ui-assistant/assistant-chat/assistant-chat.html

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,6 @@
4141
</div>
4242
</div>
4343
<div class="ai-actions">
44-
<select
45-
class="mode-select"
46-
aria-label="Agent mode"
47-
[value]="mode()"
48-
(change)="setMode($any($event.target).value)">
49-
<option value="plan">Plan</option>
50-
<option value="execution">Execution</option>
51-
</select>
5244
<button
5345
(click)="toggle()"
5446
class="icon-btn"

src/app/domains/shared/ui-assistant/assistant-chat/assistant-chat.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ import {
88
import { FormsModule } from '@angular/forms';
99
import { AgUiChatResourceRef } from '@internal/ag-ui-client';
1010

11-
import {
12-
AgentMode,
13-
AgentModeService,
14-
} from '../../util-common/agent-mode-service';
1511
import { injectAutoScroller } from '../../util-common/auto-scroll-controller';
1612
import { ChatMessages } from '../chat-messages/chat-messages';
1713
import { ChatRegistry } from '../chat-registry';
@@ -24,9 +20,6 @@ import { ChatRegistry } from '../chat-registry';
2420
})
2521
export class AssistantChat {
2622
private chatRegistry = inject(ChatRegistry);
27-
private agentMode = inject(AgentModeService);
28-
29-
protected mode = this.agentMode.mode;
3023

3124
private composerInput =
3225
viewChild<ElementRef<HTMLInputElement>>('composerInput');
@@ -86,8 +79,4 @@ export class AssistantChat {
8679
protected resumeInterrupt(approved: boolean): void {
8780
this.chat?.resumeInterrupt(approved);
8881
}
89-
90-
protected setMode(mode: AgentMode): void {
91-
this.agentMode.mode.set(mode);
92-
}
9382
}

src/app/domains/shared/util-common/agent-mode-service.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)