mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-28 05:55:17 -07:00
feat(core): simplify subagent success UI and improve early termination display (#21917)
This commit is contained in:
@@ -207,8 +207,24 @@ describe('LocalSubagentInvocation', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
expect(result.returnDisplay).toContain('Result:\nAnalysis complete.');
|
expect(result.returnDisplay).toBe('Analysis complete.');
|
||||||
expect(result.returnDisplay).toContain('Termination Reason:\n GOAL');
|
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 () => {
|
it('should stream THOUGHT_CHUNK activities from the executor', async () => {
|
||||||
@@ -296,7 +312,7 @@ describe('LocalSubagentInvocation', () => {
|
|||||||
// Execute without the optional callback
|
// Execute without the optional callback
|
||||||
const result = await invocation.execute(signal);
|
const result = await invocation.execute(signal);
|
||||||
expect(result.error).toBeUndefined();
|
expect(result.error).toBeUndefined();
|
||||||
expect(result.returnDisplay).toContain('Result:\nDone');
|
expect(result.returnDisplay).toBe('Done');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle executor run failure', async () => {
|
it('should handle executor run failure', async () => {
|
||||||
|
|||||||
@@ -253,12 +253,15 @@ Termination Reason: ${output.terminate_reason}
|
|||||||
Result:
|
Result:
|
||||||
${output.result}`;
|
${output.result}`;
|
||||||
|
|
||||||
const displayContent = `
|
const displayContent =
|
||||||
Subagent ${this.definition.name} Finished
|
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}
|
${displayResult}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user