Skip to content
Merged
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
218adcd
feat(cli): migrate nonInteractiveCli to LegacyAgentSession
adamfweidman Mar 20, 2026
b268e93
refactor(cli): handle max turns from stream end
adamfweidman Mar 20, 2026
3e0b8aa
fix(cli): consume the stream returned by send
adamfweidman Mar 20, 2026
f77e471
!feat(cli): adopt protocol-backed agent session streaming
adamfweidman Mar 20, 2026
2dfe237
!feat(cli): address non-interactive review follow-ups
adamfweidman Mar 20, 2026
25c5d44
!feat(cli): harden non-interactive agent session handling
adamfweidman Mar 20, 2026
9332243
fix(cli): align non-interactive loop warning handling
adamfweidman Mar 23, 2026
56656df
fix(cli): preserve max-turns non-interactive parity
adamfweidman Mar 23, 2026
6fb7bcf
fix(core): preserve first-turn display content
adamfweidman Mar 26, 2026
6a80311
Merge branch 'main' into pr4-cli
mbleigh Mar 27, 2026
8e9961a
fixes
adamfweidman Mar 29, 2026
3b0906f
Merge branch 'main' into pr4-cli
mbleigh Mar 30, 2026
52f2479
feat(core): add agent protocol UI types and experimental flag
mbleigh Mar 30, 2026
e02072a
feat(config): add experimental.adk.agentSessionNoninteractiveEnabled …
adamfweidman Apr 1, 2026
f34b146
feat(cli): migrate nonInteractiveCli to LegacyAgentSession
adamfweidman Mar 20, 2026
6d8cee7
refactor(cli): handle max turns from stream end
adamfweidman Mar 20, 2026
c3b5bcb
fix(cli): consume the stream returned by send
adamfweidman Mar 20, 2026
f7b0833
!feat(cli): adopt protocol-backed agent session streaming
adamfweidman Mar 20, 2026
24a4a0d
!feat(cli): address non-interactive review follow-ups
adamfweidman Mar 20, 2026
7c7150f
!feat(cli): harden non-interactive agent session handling
adamfweidman Mar 20, 2026
6795567
fix(cli): align non-interactive loop warning handling
adamfweidman Mar 23, 2026
1088e1f
fix(cli): preserve max-turns non-interactive parity
adamfweidman Mar 23, 2026
bb459de
fix(core): preserve first-turn display content
adamfweidman Mar 26, 2026
cd34c96
fixes
adamfweidman Mar 29, 2026
9dfe9ee
feat(cli): split nonInteractiveCli and implement flag toggle (proper …
adamfweidman Apr 1, 2026
ab2f9bd
Merge branch 'origin/main' into pr4-cli
adamfweidman Apr 1, 2026
05baea6
fix(cli): fix tests and remove unused imports in non-interactive agen…
adamfweidman Apr 1, 2026
6c2f005
Merge branch 'pr4-cli' into mb/agents/01-core-types-fixes
mbleigh Apr 2, 2026
839c6da
Merge branch 'main' into mb/agents/01-core-types-fixes
mbleigh Apr 3, 2026
35905c2
Merge branch 'main' of github.com:google-gemini/gemini-cli into mb/ag…
mbleigh Apr 3, 2026
8a00e41
fix: address PR feedback for non-interactive and event translator
mbleigh Apr 3, 2026
9b40e96
fix: restore nonInteractiveCli.ts and update AgentSession logic
mbleigh Apr 3, 2026
72ec782
fix: trim PR and move interactive flag to ADK settings
mbleigh Apr 3, 2026
430a52f
fix: use agentSessionInteractiveEnabled
mbleigh Apr 3, 2026
d564eb7
refactor(core): make LegacyAgentSession dependencies optional
mbleigh Mar 30, 2026
ed02920
feat(cli): implement useAgentStream hook
mbleigh Mar 30, 2026
a6b3fb5
Merge branch 'main' into mb/agents/04-use-agent-stream
mbleigh Apr 8, 2026
3483f6a
fix(cli): address PR feedback for useAgentStream inactivity and depen…
mbleigh Apr 8, 2026
e28dc9f
chore(cli): add TODO for shell state integration in useAgentStream
mbleigh Apr 8, 2026
55079cb
fix(cli): address useAgentStream cleanup and import feedback
mbleigh Apr 8, 2026
55e23dc
chore(cli): reset ToolGroupMessage snapshots to main
mbleigh Apr 8, 2026
942ba6e
Merge branch 'main' into mb/agents/04-use-agent-stream
mbleigh Apr 8, 2026
0e62169
fix(cli): handle unknown agent events and add exhaustiveness check
mbleigh Apr 9, 2026
e8edc76
Merge branch 'main' into mb/agents/04-use-agent-stream
mbleigh Apr 9, 2026
9a39539
feat(cli): wire up useAgentStream in AppContainer
mbleigh Mar 30, 2026
c408b3c
Merge branch 'main' into mb/agents/05-app-container
mbleigh Apr 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 44 additions & 22 deletions packages/cli/src/ui/AppContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ import {
buildUserSteeringHintPrompt,
logBillingEvent,
ApiKeyUpdatedEvent,
LegacyAgentProtocol,
type InjectionSource,
startMemoryService,
} from '@google/gemini-cli-core';
Expand Down Expand Up @@ -118,6 +119,7 @@ import { computeTerminalTitle } from '../utils/windowTitle.js';
import { useTextBuffer } from './components/shared/text-buffer.js';
import { useLogger } from './hooks/useLogger.js';
import { useGeminiStream } from './hooks/useGeminiStream.js';
import { useAgentStream } from './hooks/useAgentStream.js';
import { type BackgroundTask } from './hooks/useExecutionLifecycle.js';
import { useVim } from './hooks/vim.js';
import { type LoadableSettingScope, SettingScope } from '../config/settings.js';
Expand Down Expand Up @@ -1161,6 +1163,46 @@ Logging in with Google... Restarting Gemini CLI to continue.
};
}, [config]);

const streamAgent = useMemo(
() =>
config?.getAgentSessionInteractiveEnabled()
? new LegacyAgentProtocol({ config, getPreferredEditor })
: undefined,
[config, getPreferredEditor],
);

const activeStream = streamAgent
? // eslint-disable-next-line react-hooks/rules-of-hooks
useAgentStream({
agent: streamAgent,
addItem: historyManager.addItem,
onCancelSubmit,
isShellFocused: embeddedShellFocused,
logger,
})
: // eslint-disable-next-line react-hooks/rules-of-hooks
useGeminiStream(
config.getGeminiClient(),
historyManager.history,
historyManager.addItem,
config,
settings,
setDebugMessage,
handleSlashCommand,
shellModeActive,
getPreferredEditor,
onAuthError,
performMemoryRefresh,
modelSwitchedFromQuotaError,
setModelSwitchedFromQuotaError,
onCancelSubmit,
setEmbeddedShellFocused,
terminalWidth,
terminalHeight,
embeddedShellFocused,
consumePendingHints,
);
Comment thread
mbleigh marked this conversation as resolved.

const {
streamingState,
submitQuery,
Expand All @@ -1180,27 +1222,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
backgroundTasks,
dismissBackgroundTask,
retryStatus,
} = useGeminiStream(
config.getGeminiClient(),
historyManager.history,
historyManager.addItem,
config,
settings,
setDebugMessage,
handleSlashCommand,
shellModeActive,
getPreferredEditor,
onAuthError,
performMemoryRefresh,
modelSwitchedFromQuotaError,
setModelSwitchedFromQuotaError,
onCancelSubmit,
setEmbeddedShellFocused,
terminalWidth,
terminalHeight,
embeddedShellFocused,
consumePendingHints,
);
} = activeStream;

const pendingHistoryItems = useMemo(
() => [...pendingSlashCommandHistoryItems, ...pendingGeminiHistoryItems],
Expand Down Expand Up @@ -1783,7 +1805,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
if (keyMatchers[Command.QUIT](key)) {
// If the user presses Ctrl+C, we want to cancel any ongoing requests.
// This should happen regardless of the count.
cancelOngoingRequest?.();
void cancelOngoingRequest?.();

handleCtrlCPress();
return true;
Expand Down
Loading