Summary
When using agy -p --conversation <ID> "prompt", stdout returns the entire conversation history (all previous responses concatenated), not just the latest response. This makes it impossible to reliably extract only the new response without external workarounds.
Use Case
We are building an adapter that wraps agy -p as a backend for a multi-turn agent protocol (ACP). Each turn, we send a prompt and need only the new response to forward to the user. Currently we have to:
- Read the SQLite
.db conversation file after agy exits
- Parse protobuf blobs from the
steps table
- Track
last_step_idx to compute delta
This works but is fragile — it depends on internal DB schema and protobuf field layout that could change between versions.
Proposed Solution
One of:
Option A: --last-only flag
agy --conversation <ID> -p --last-only "prompt"
# stdout: only the latest response text
Option B: --output-format json
agy --conversation <ID> -p --output-format json "prompt"
# stdout: {"response": "...", "conversation_id": "...", "step_idx": 5}
Option C: --since-step <N>
agy --conversation <ID> -p --since-step 3 "prompt"
# stdout: only responses from step 4 onwards
Why This Matters
- Correctness: Current approach requires reverse-engineering internal storage format
- Stability: Any schema/protobuf change breaks downstream adapters
- Simplicity: A stdout-only solution eliminates the need for SQLite + protobuf dependencies in adapters
- Ecosystem: Makes
agy -p composable in shell pipelines and CI/CD
Current Workaround
Reading ~/.gemini/antigravity-cli/conversations/<id>.db → SELECT step_payload FROM steps WHERE idx > N AND step_type = 15 → decode protobuf field 20.1 for text.
Environment
- agy version: 1.0.4
- OS: Linux
- Mode: non-interactive (
-p with --conversation)
Summary
When using
agy -p --conversation <ID> "prompt", stdout returns the entire conversation history (all previous responses concatenated), not just the latest response. This makes it impossible to reliably extract only the new response without external workarounds.Use Case
We are building an adapter that wraps
agy -pas a backend for a multi-turn agent protocol (ACP). Each turn, we send a prompt and need only the new response to forward to the user. Currently we have to:.dbconversation file afteragyexitsstepstablelast_step_idxto compute deltaThis works but is fragile — it depends on internal DB schema and protobuf field layout that could change between versions.
Proposed Solution
One of:
Option A:
--last-onlyflagOption B:
--output-format jsonOption C:
--since-step <N>Why This Matters
agy -pcomposable in shell pipelines and CI/CDCurrent Workaround
Reading
~/.gemini/antigravity-cli/conversations/<id>.db→SELECT step_payload FROM steps WHERE idx > N AND step_type = 15→ decode protobuf field 20.1 for text.Environment
-pwith--conversation)