Skip to content

Surface plan mode transitions in timeline for Antigravity and Claude - #1223

Merged
Tryanks merged 3 commits into
Tryanks:mainfrom
ClanEver:feat/plan-mode-observability
Dec 4, 2026
Merged

Tryanks merged 3 commits into
Tryanks:mainfrom
ClanEver:feat/plan-mode-observability

Conversation

@EverClan

@EverClan EverClan commented Dec 2, 2026

Copy link
Copy Markdown

What changed

When running Antigravity's Orchestrator models (such as Orchestrator (Neon)), the planning model hands off its Markdown blueprint via exit_plan_mode (rawInput.plan), and the execution model hands control back via enter_plan_mode (rawInput.reason). Previously both calls fell through to generic ItemContent::ToolCall items folded into the Work Log as raw JSON, hiding the planner/executor phase boundaries inside a single activity run.

  • Canonical stream (crates/agent/src/lib.rs, crates/protocol/src/lib.rs):
    • Added ItemContent::PlanModeEntered { reason: Option<String> } (plan_mode_entered) as the canonical counterpart to ItemContent::Plan, noted under Unreleased above PROTOCOL_VERSION (Principle 9).
    • Antigravity's Run exit_plan_mode now maps into the existing ItemContent::Plan { markdown } owner; Run enter_plan_mode maps into ItemContent::PlanModeEntered { reason }. Failed updates revert to a failed ItemContent::ToolCall so errors stay visible, and exit_plan_mode calls without plan text fall through unchanged.
    • Claude Code's EnterPlanMode now maps into ItemContent::PlanModeEntered { reason: None } on success and falls back to a failed/declined ItemContent::ToolCall when is_error is true.
  • Core, indexing & export (crates/core, crates/services):
    • Folded PlanModeEntered in session.rs, included it in relay.rs, indexed it under "plan_mode_entered" in thread_index.rs and session_search.rs, and formatted it in export.rs.
  • Timeline UI & localization (crates/ui, locales/{en,zh-CN,ja}.yml):
    • Segment::PlanModeEntered breaks out of ActivityRun alongside Segment::Plan, separating planning and execution activity runs cleanly.
    • Extended the existing notices::said_line primitive with an optional body field (and multi-line expandability) rather than duplicating a disclosure component: PlanModeEntered renders as a centered muted line with IconName::Map, showing a one-line summary of reason when present and opening the full reason in a disclosure card when clicked.
    • Added chat.plan_mode_entered and chat.plan_mode_entered_reason to en.yml, zh-CN.yml, and ja.yml.

Tests

  • agent::antigravity::tests::plan_mode_tools_map_to_plan_and_plan_mode_entered: verifies ACP Run exit_plan_mode / Run enter_plan_mode mapping across tool_call -> tool_call_update, failure fallback to ToolCall, and empty-plan passthrough.
  • agent::claude::tests::enter_plan_mode_maps_to_plan_mode_entered_and_keeps_errors_visible: verifies EnterPlanMode success mapping and error fallback.
  • tcode_ui::chat::model::tests::segmentation_preserves_message_order_and_groups_adjacent_activities: extended to cover Plan and PlanModeEntered splitting ActivityRun segments and disclosure_keys registration.
  • tcode_ui::chat::timeline::render::tests::plan_mode_entered_discloses_multiline_reason_on_click: verifies Plan and PlanModeEntered render outside the Work Log and clicking a multi-line PlanModeEntered line expands its disclosure body.

Verification

  • cargo fmt --all --check — passed
  • cargo machete — passed
  • RUSTUP_TOOLCHAIN=1.100.1 mbx clippy --workspace --all-targets --locked -- -D warnings — passed
  • RUSTUP_TOOLCHAIN=1.100.1 mbx nextest run --workspace --locked --no-fail-fast -E 'not test(=claude::tests::a_session_previews_rewinds_and_reports_the_part_claude_refused)' — 1544 passed, 4 failed due to local environment gaps (wayland-nest tests require sway; two tcode-traverse tests require IPv6 loopback); all affected crates (agent, tcode-core, tcode-protocol, tcode-services, tcode-runtime, tcode-ui, tcode, tcode-headless) passed with zero failures.
  • Live probe: mbx run -p agent --example probe --locked -- antigravity ... --model gemini-pro-orchestrator-neon against agy 1.5.20 — observed item_started/item_completed for both plan and plan_mode_entered.
  • Desktop visual check: ran a live Orchestrator (Neon) turn in the desktop build under a throwaway TCODE_DATA_DIR, verified the Plan card, separated execution Work Log, collapsed 进入规划模式 line, and expanded multi-line disclosure card.
  • Not run locally: macOS/Windows/iOS/Android/web CI jobs.

ClanEver and others added 3 commits December 3, 2026 06:07
The index holds what an item carries, not the UI's words for it; an English
"Entered plan mode" fallback would match only in English and never in the
locale the timeline shows.
# Conflicts:
#	crates/agent/src/antigravity.rs
@Tryanks
Tryanks merged commit d235578 into Tryanks:main Dec 4, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants