Skip to content

feat(mobile): support Antigravity conversation view - #973

Open
Cec1c wants to merge 3 commits into
Kuddev:mainfrom
Cec1c:feat/mobile-antigravity-conversation
Open

Cec1c wants to merge 3 commits into
Kuddev:mainfrom
Cec1c:feat/mobile-antigravity-conversation

Conversation

@Cec1c

@Cec1c Cec1c commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Enable Mobile Conversation View (对话视图 / ConversationScreen) and Desktop Runtime conversation.* projection for Antigravity (agy) panes across local, WSL, and built-in SSH environments.

Cause & Context

  • Android's "conversation" route and Desktop runtime_api::conversation previously gated on kind in {"codex", "claude"}, causing Antigravity panes to display the placeholder waiting for a Codex or Claude Code session file.
  • Unlike Codex and Claude Code, Antigravity's hook payload reports conversationId without a transcript_path field; instead, Antigravity deterministically writes transcript_full.jsonl (and transcript.jsonl) under <HOME>/.gemini/antigravity-cli/brain/<conversationId>/.system_generated/logs/.

Key Changes

  1. Desktop Runtime & Off-Thread Brain Transcript Resolution (nebula_app/src/runtime_api/conversation.rs, nebula_app/src/gpui_shell/terminal/view/conversation.rs, nebula_app/src/assistant_answer/conversation/antigravity.rs, nebula_app/src/platform/local_paths.rs):
    • Accept "antigravity" in runtime_api::conversation while keeping TerminalView::runtime_conversation_source free of disk or guest I/O on the UI thread (valid_antigravity_session_id rejects ., .., leading dots, and path separators).
    • Resolve <HOME>/.gemini/antigravity-cli/brain/<session_id>/.system_generated/logs/transcript_full.jsonl (falling back to transcript.jsonl only when transcript_full.jsonl is absent; returning conversation_changed if transcript_full.jsonl appears mid-read) inside the owning environment:
      • Local: walk segments under home_dir() rejecting symlinks/reparse points and open the leaf via open_regular_file_no_follow (O_NOFOLLOW on Unix, FILE_FLAG_OPEN_REPARSE_POINT + attribute verification on Windows).
      • WSL & SSH: verify non-symlink segments in $HOME / ~ ([ ! -L ... ] in WSL; os.lstat + O_NOFOLLOW in remote_read.py) and return the resolved path for ownership verification.
  2. Ownership & Native Step Projection (nebula_app/src/assistant_answer/conversation.rs, nebula_app/src/assistant_answer/conversation/antigravity.rs):
    • Verify <session_id>/.system_generated/logs/transcript[_full].jsonl suffix and require a non-SYSTEM first step in validate_source so subagent transcripts fail closed.
    • Unwrap only the outer <USER_REQUEST>...</USER_REQUEST> envelope on USER_INPUT (preserving literal inner tags and repeated identical messages), emit assistant prose and FIFO tool_calls from PLANNER_RESPONSE while omitting "thinking", pair MODEL GENERIC outputs (marking detached "RUNNING" background-task launches completed once returned), and skip SYSTEM records.
  3. Android Conversation View Gate & Copy (MainActivity.kt, values/strings.xml, values-zh-rCN/strings.xml, DesktopRecoveryTest.kt):
    • Extract supportsConversationView(kind) allowing "codex", "claude", and "antigravity", update chat_unavailable in English and Simplified Chinese, and add unit coverage in DesktopRecoveryTest.
  4. Causal Note:
    • Record design rationale and rejected alternatives in architecture/notes/nebula_app/assistant_answer/conversation/2026-11-13-antigravity-conversation-projection.md.

Verification

  • cargo test -p nebula --bin pebrel --features "gpui-shell,gpui-test-support" --locked conversation (15 passed)
  • cargo test -p nebula --bin pebrel --features "gpui-shell,gpui-test-support" --locked local_paths (4 passed)
  • cargo test -p nebula --test file_line_budget --locked (2 passed)
  • cargo check --locked --workspace
  • py -3.12 scripts/check_architecture.py --base 09e5eb47ed38a81b60b8cc0eba69a0c68004b0c9
  • py -3.12 scripts/check_platform_cfg.py (459 / 459)
  • py -3.12 scripts/check_prohibited_names.py range --base 09e5eb47ed38a81b60b8cc0eba69a0c68004b0c9 --head HEAD
  • Note: Local Windows environment does not have the Android SDK installed; Android :app:testDebugUnitTest and :app:lintPreview are left for the Android workflow environment.

Allow Antigravity (`agy`) panes to open Mobile Conversation View and
participate in `conversation.read`, `send`, `choose`, and `key`.

Because Antigravity hooks report `conversationId` without an explicit
`transcript_path`, resolve `<HOME>/.gemini/antigravity-cli/brain/<id>/
.system_generated/logs/transcript_full.jsonl` (with `transcript.jsonl`
fallback) off-thread inside the owning local, WSL, or SSH environment:
- validate single-segment ASCII session IDs and reject symlinks or
  Windows reparse points across ancestor directories and leaf files;
- reject subagent transcripts whose initial step has `source: "SYSTEM"`;
- unwrap outer `<USER_REQUEST>` envelopes while preserving nested markup
  and repeated messages, omit private `thinking` and `SYSTEM` records,
  and pair `PLANNER_RESPONSE` tool calls with `GENERIC` tool outputs.
@Cec1c
Cec1c requested a review from Kuddev as a code owner November 13, 2026 05:46
…paging coverage

Parse the JSON record header prefix before "content" via serde_json when
the first transcript line exceeds HEAD_BYTES without a newline, so
whitespace-spaced "source": "SYSTEM" subagent headers still fail closed,
and add multi-page backward-cursor projection coverage starting mid-turn
on a GENERIC tool-output step.
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.

1 participant