Skip to content

feat(agent-history): add Antigravity CLI (agy) history reader - #2

Open
dorokuma wants to merge 3 commits into
ryonakae:mainfrom
dorokuma:feat/agy-history-reader
Open

feat(agent-history): add Antigravity CLI (agy) history reader#2
dorokuma wants to merge 3 commits into
ryonakae:mainfrom
dorokuma:feat/agy-history-reader

Conversation

@dorokuma

@dorokuma dorokuma commented Aug 19, 2026

Copy link
Copy Markdown

What

Adds an AgentHistoryReader for Antigravity CLI (agy), so Shepherd can surface the last assistant message for agy agents managed through Herdr (agent_session refs with source herdr:antigravity_cli previously resolved to unknown, leaving wake summaries empty).

How

  • New AgyHistoryReader parses ${HOME}/.gemini/antigravity-cli/brain//.system_generated/logs/transcript.jsonl. Line mapping: USER_INPUT -> user; PLANNER_RESPONSE with text content -> assistant; PLANNER_RESPONSE with only tool_calls -> tool_result (tool name from the first call). Malformed lines are skipped, matching the existing readers.
  • historySourceFromSessionRef maps agent agy / antigravity* refs to the new agy-jsonl source. Discovery resolves kind: id refs to the transcript path and scans the brain directory (most recently modified transcript first).
  • Directory auto-discovery filters candidate transcripts by the agent's cwd using conversation_summaries.db (workspace_uris), so concurrently running agy agents do not pick up each other's transcripts. When no conversation matches the cwd, discovery returns no history instead of an unrelated one. If the summaries database is missing or unreadable, discovery falls back to the newest transcript.
  • The agy-jsonl source type is appended to the AgentHistoryRef union; AgyHistoryReader is appended to the default reader list. No existing reader is touched.

Testing

  • 12 new unit tests: multi-turn parsing, tool-only responses, empty file, malformed JSON lines, missing file, session-id path resolution, default service registration, source mapping, brain directory discovery, mtime ordering across multiple sessions, cwd filtering via conversation summaries, no-cwd-match returning no history.
  • Full suite: 239 tests passing. tsc --noEmit, biome check, and build are clean.

Note: agy transcripts do not embed a cwd; directory auto-discovery matches the agent's cwd against conversation_summaries.db when available and falls back to the newest transcript otherwise.

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