- Hide "? for shortcuts" when a custom status line is configured
(status line already occupies the top row, hint is redundant)
- Hide status line during Ctrl+C/D exit prompts to keep footer
at one row during exit flow
- Matches upstream Claude Code suppressHint + exitMessage behavior
AutoAcceptIndicator and ShellModeIndicator returned Box>Text, which
prevented the parent Text wrap="truncate" from working (ink cannot
nest Box inside Text). Change both to return plain Text elements
so the footer's truncation applies correctly on narrow terminals.
Wrap leftBottomContent in Text with wrap="truncate" so the
hints/mode row stays on a single line, matching upstream behavior.
This guarantees the footer is at most 2 rows (status line + hints).
Restructure footer to match Claude Code's layout:
- Left column: status line (top, truncated) + hints/mode (bottom)
- Both rows coexist instead of being mutually exclusive
- Status line uses wrap="truncate" to guarantee single line
- Approval mode returns to the hints row (inline, not separate row)
- Left column uses flexShrink for narrow terminals
Add flexGrow/flexShrink to left section so it takes available space
but yields to right items. Add flexShrink={0} to right section so
context usage, verbose, sandbox indicators are never compressed.
Add overflow="hidden" to left section for clean truncation.
The status line is now inlined in the footer's left section,
so horizontal padding is no longer applicable. Remove padding
from StatusLineConfig, settings schema, JSON schema, and docs.
Move status line from a dedicated row below the footer into the
footer's left section, replacing "? for shortcuts" when active.
High-priority messages (Ctrl+C/D, Esc, vim INSERT, shell mode)
still override the status line.
Move approval mode indicator to a separate row below the footer,
shown only when mode is non-default. This eliminates the empty
gap in default mode and matches upstream layout.
- Compute remaining_percentage as round(100 - used) to guarantee
used + remaining always sums to exactly 100.0
- Reject empty or whitespace-only command strings in config validation
useStatusLine hook accesses sessionStats.metrics.tools.totalCalls,
sessionStats.metrics.files.totalLinesAdded, and currentModel which
were missing from the mock UIState, causing a TypeError crash during
render and making 4 Footer tests fail in CI.
Restructure the status line stdin JSON for clarity and accuracy:
- Rename model.id → model.display_name, cwd → workspace.current_dir
- Replace raw context_window size/count with used_percentage,
remaining_percentage, current_usage, context_window_size, and
total_input_tokens/total_output_tokens
- Add version field from cfg.getCliVersion()
- Add git.branch, metrics.models, metrics.files
- Remove upstream-only fields: tokens.tool (never populated),
session (start_time/elapsed_time not live-updating),
streaming_state, approval_mode, terminal, metrics.tools
- Rename tokens.candidates → tokens.completion (Qwen API convention)
- Fix template string escaping in builtin-agents to avoid
templateString() placeholder collision
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Align with observed provider prompt-cache TTL (~5 min). Add
`context.gapThresholdMinutes` setting so users can tune the threshold
for providers with different cache TTLs.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rename the subcommand to accurately reflect its behavior (exits plan
mode and restores previous approval mode, does not trigger execution).
Update source, tests, i18n keys (6 locales), and docs.
Most Qwen OAuth users don't have a fast model configured for this
feature, so it fires a wasted API request on every turn with no
visible benefit. Default to off; users can opt in via settings.
Same class of Windows CI timing flake — the backspace keypress
doesn't propagate through the paste/keypress pipeline fast enough
on slow runners, so replaceRangeByOffset is never called (0 calls).
The test has a stale closure race condition: the 50ms wait between
pressing '2' and Enter may not be enough for React/Ink to re-render
and re-subscribe the useKeypress callback with the updated
selectedIndex, causing it to read the default value (0) instead of
the expected value (1) on slow CI runners (Windows + Node 20).
* feat(core): implement mid-turn queue drain for agent execution
Inject queued user messages between tool execution steps within a single
turn, so the model sees them immediately instead of waiting for the
entire round to complete.
- Add `dequeueAll()` to AsyncMessageQueue
- Add `midTurnDrain` callback to ReasoningLoopOptions
- Drain queue after processFunctionCalls, inject as text parts
- AgentComposer always enqueues directly (no local buffering)
- Add QUEUE_MESSAGES_CONSUMED event for UI sync
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(cli): add mid-turn queue drain to main session
Extend mid-turn queue drain to the main session's tool execution path
(useGeminiStream). Previously only agent tabs had this feature.
- Add midTurnDrainRef parameter to useGeminiStream
- Inject queued messages in handleCompletedTools before submitQuery
- Bridge useMessageQueue to drain ref in AppContainer via ref pattern
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address Copilot review feedback on mid-turn drain
- Guard midTurnDrain with abort check to prevent message loss on cancel
- Synchronously clear messageQueueRef to prevent duplicate drains
- Only clear pending display on IDLE status, not all status changes
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: scope mid-turn drain to main session only
Revert subagent-path changes (AgentCore, AgentInteractive,
AgentComposer, AsyncMessageQueue, agent-events) to keep the PR
focused on the main session, which is easier to test and validate.
Subagent mid-turn drain can be added in a follow-up PR.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address Copilot review on main session mid-turn drain
- Move synchronous queue ref into useMessageQueue itself, expose
drainQueue() for atomic drain (fixes race between addMessage and drain)
- Record drained messages as USER history items so the transcript
stays complete
- Simplify AppContainer bridge to just midTurnDrainRef.current = drainQueue
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: guard mid-turn drain against cancelled turns
- Skip drain when turnCancelledRef or abortController signal is set,
so queued messages stay for the next turn instead of being lost
- Restore ref-based queue bridge (drainQueue removed from useMessageQueue)
- Keep synchronous ref clear to prevent duplicate drains
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Per maintainer review (tanzhenxin): default verboseMode reverted to true
to preserve existing behavior — compact mode is opt-in via Ctrl+O.
Also addresses wenshao's security concern: in compact mode, tool groups
now force-expand on Error status (in addition to existing Confirming
handling), and ToolMessage force-shows result for both Confirming and
Error statuses so users always see diffs before approval and error
details for debugging.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
"Use the Agent tool with subagent_type" is more direct than
"Create an Agent", reducing ambiguity for the model.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Footer comment now accurately states only the "? for shortcuts"
hint is suppressed, not all left-section items
- Docs now note that Windows uses cmd.exe by default and suggest
wrapping commands with bash -c or using a bash script
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When entering plan mode, Config now saves the previous approval mode
(e.g. AUTO_EDIT, YOLO) so it can be restored when exiting. Previously,
/plan execute and ExitPlanModeTool both hardcoded a return to DEFAULT,
losing the user's prior mode.
Changes:
- Config: add prePlanMode field, getPrePlanMode(), auto-track in
setApprovalMode()
- planCommand: /plan execute restores prePlanMode instead of DEFAULT
- ExitPlanModeTool: ProceedOnce restores prePlanMode instead of DEFAULT
- Tests: 4 new Config tests, 1 new planCommand test, 1 new
ExitPlanModeTool test
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix default value: compact mode (verboseMode=false) is now the default,
matching PR description and intended UX
- Extract shared ToolStatusIndicator component to eliminate duplicate
status icon rendering between ToolMessage and CompactToolGroupDisplay
- Memoize VerboseModeProvider context value to prevent unnecessary
re-renders of all consumer components
- Clear frozenSnapshot on WaitingForConfirmation state to ensure tool
confirmation UI remains interactive during mid-stream toggle
- Replace magic string 'Shell' with SHELL_NAME constant in ToolMessage
- Remove unused i18n translation keys (verbose/compact mode messages)
- Update snapshots for Footer and ToolGroupMessage tests
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Agent can now ask for clarification when PS1 is not found
- Clear pending debounce timer before immediate doUpdate on command
change to prevent redundant second execution
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When statusLineCommand becomes undefined (user removes the setting),
kill any in-flight child process, bump generation counter, and clear
the debounce timer so stale callbacks cannot resurrect the output.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Set cwd to config.getTargetDir() so commands like pwd/git run in the
correct workspace directory
- Strip only trailing newline instead of trim() to preserve intentional
leading/trailing whitespace in command output
- Match footer's marginLeft/marginRight on the status line row so it
aligns with the rest of the footer content
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When vim mode is toggled off, vimMode stays the same but the status
line should stop including vim data. Use effectiveVim (undefined when
disabled) as the tracked value instead of raw vimMode.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Validate padding is finite number >= 0 instead of blind cast
- Initialize prevStateRef with current values to prevent double exec on mount
- Kill previous child process before starting new one; kill on unmount
- Fix agent prompt: settings path is ui.statusLine, not root-level
- Fix agent prompt: remove multi-cat examples, stdin can only be read once
- Update Footer left-section comment to reflect new behavior
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
useStatusLine hook requires SettingsContext, which was missing from
the test render wrapper, causing all Footer tests to crash.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rewrite the status line feature (originally by Gemini 3.1 Pro) to align
with the upstream design:
- Settings: change from plain string to object `{ type, command, padding? }`
- Hook: event-driven with 300ms debounce instead of 5s polling; pass
structured JSON context (session, model, tokens, vim) via stdin;
generation counter to ignore stale exec callbacks; EPIPE guard on stdin
- Footer: render status line as dedicated row with dimColor + truncate;
suppress "? for shortcuts" hint when status line is active
- Add `/statusline` slash command that delegates to a statusline-setup agent
- Add `statusline-setup` built-in agent with PS1 conversion instructions
- Remove unrelated changes (whitespace, formatting, package-lock, test file)
- Fix copyright headers (Google LLC → Qwen)
- Fix config path references (~/.qwen-code → ~/.qwen)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix /plan execute running without checking if currently in plan mode
- Remove hallucinated i18n keys (e.g. "Coding Plan API keys") added by
prior AI-generated code
- Remove /plan from non-interactive command allowlist (plan mode is
interactive)
- Revert unrelated package-lock.json and unused-keys-only-in-locales.json
changes
- Add test case for /plan execute when not in plan mode
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add /plan command to switch to plan mode or execute the current plan
- Update BuiltinCommandLoader to include planCommand
- Allow planCommand in non-interactive environments
- Add corresponding unit tests
- Update i18n locales to include new translations
- Document /plan command in features/commands.md