mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 14:10:37 -07:00
feat(core): simplify subagent success UI and improve early termination display
This commit is contained in:
@@ -202,8 +202,24 @@ describe('LocalSubagentInvocation', () => {
|
||||
),
|
||||
},
|
||||
]);
|
||||
expect(result.returnDisplay).toContain('Result:\nAnalysis complete.');
|
||||
expect(result.returnDisplay).toContain('Termination Reason:\n GOAL');
|
||||
expect(result.returnDisplay).toBe('Analysis complete.');
|
||||
expect(result.returnDisplay).not.toContain('Termination Reason');
|
||||
});
|
||||
|
||||
it('should show detailed UI for non-goal terminations (e.g., TIMEOUT)', async () => {
|
||||
const mockOutput = {
|
||||
result: 'Partial progress...',
|
||||
terminate_reason: AgentTerminateMode.TIMEOUT,
|
||||
};
|
||||
mockExecutorInstance.run.mockResolvedValue(mockOutput);
|
||||
|
||||
const result = await invocation.execute(signal, updateOutput);
|
||||
|
||||
expect(result.returnDisplay).toContain(
|
||||
'### Subagent MockAgent Finished Early',
|
||||
);
|
||||
expect(result.returnDisplay).toContain('**Termination Reason:** TIMEOUT');
|
||||
expect(result.returnDisplay).toContain('Partial progress...');
|
||||
});
|
||||
|
||||
it('should stream THOUGHT_CHUNK activities from the executor', async () => {
|
||||
@@ -291,7 +307,7 @@ describe('LocalSubagentInvocation', () => {
|
||||
// Execute without the optional callback
|
||||
const result = await invocation.execute(signal);
|
||||
expect(result.error).toBeUndefined();
|
||||
expect(result.returnDisplay).toContain('Result:\nDone');
|
||||
expect(result.returnDisplay).toBe('Done');
|
||||
});
|
||||
|
||||
it('should handle executor run failure', async () => {
|
||||
|
||||
@@ -253,12 +253,15 @@ Termination Reason: ${output.terminate_reason}
|
||||
Result:
|
||||
${output.result}`;
|
||||
|
||||
const displayContent = `
|
||||
Subagent ${this.definition.name} Finished
|
||||
const displayContent =
|
||||
output.terminate_reason === AgentTerminateMode.GOAL
|
||||
? displayResult
|
||||
: `
|
||||
### Subagent ${this.definition.name} Finished Early
|
||||
|
||||
Termination Reason:\n ${output.terminate_reason}
|
||||
**Termination Reason:** ${output.terminate_reason}
|
||||
|
||||
Result:
|
||||
**Result/Summary:**
|
||||
${displayResult}
|
||||
`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user