fix(agy-acp): support .db conversation format (agy v1.0.4)#980
Conversation
|
All PRs must reference a prior Discord discussion to ensure community alignment before implementation. Please edit the PR description to include a link like: This PR will be automatically closed in 3 days if the link is not added. |
OpenAB PR ScreeningThis is auto-generated by the OpenAB project-screening flow for context collection and reviewer handoff.
Screening reportdone.Comment: #980 (comment) One note: the local sandbox rejected non- |
2cae99b to
53ea59c
Compare
|
LGTM ✅ — SQLite-based delta extraction replaces fragile stdout parsing What This PR DoesAdapts agy-acp to Antigravity CLI v1.0.4's new SQLite conversation format. Replaces the line-count/hash-based stdout delta extraction with direct SQLite reads from the conversation How It WorksAfter SELECT idx, step_payload FROM steps WHERE idx > ?1 AND step_type = 15 ORDER BY idxExtracts response text from protobuf Findings
Baseline Check
What's Good (🟢)
|
178f1ae to
df0ea88
Compare
9605ef4 to
290f349
Compare
86531dc to
79bf6cd
Compare
Antigravity CLI v1.0.4 changed conversation storage from protobuf (.pb) to SQLite (.db). Update conversation_snapshot() to detect both formats. Without this fix, session binding silently fails on agy v1.0.4+ because new .db files are never detected in the filesystem diff. Closes #979
Replace fragile stdout line-count delta with SQLite-based extraction: - After agy exits, open the .db and query steps table for new steps - Extract response text from step_payload protobuf (field 8, tag 0x42) - Track last_step_idx in session state for precise delta - Falls back to stdout line-count parsing if SQLite read fails This eliminates dependency on stdout format stability and correctly handles multi-line responses without line-counting heuristics. Ref #979
Remove all line-count/hash-based delta extraction (extract_delta, prev_line_count, prev_last_line_hash, DefaultHasher). Session state now only tracks conversation_id + last_step_idx. Delta extraction reads directly from the .db steps table via rusqlite. Falls back to full stdout only if SQLite read fails (no text found). Also dropped .pb support from conversation_snapshot() — agy v1.0.4+ only creates .db files. Ref #979
- F2: If SQLite read returns no text, send empty string instead of full history (which would duplicate all previous responses) - F1: Log warning when steps exist but field 8 extraction fails, indicating a protobuf schema change in agy Ref #979
Instead of sending empty text that confuses the user, return a JSON-RPC error so OAB can surface it properly. Ref #979
- Fix extract_text_from_step_payload to read field 20 → field 1 - Filter SQL query by step_type=15 (agent response steps only) - Add prepare_auth() for CI auth seed via presigned URL - Add e2e test (test_e2e_agy_acp_full_round_trip) - Add GitHub Actions workflow (e2e-agy-acp.yml) - Add publish-auth-seed.sh script
agy stores OAuth tokens in system keyring which isn't portable to CI. Use GEMINI_API_KEY env var instead - simpler, no expiry concerns.
Address review feedback: - Verify 'steps' table exists before querying (returns None with log if schema changed) - Log payload sizes on extraction failure for diagnostics - Add test_read_response_multi_step_no_skip_no_duplicate: verifies incremental delta with mixed user (step_type=0) and bot (step_type=15) steps, confirms no skip/duplicate across multiple reads - Add test_read_response_missing_steps_table: verifies graceful handling when DB schema is different Ref #979
Add version check after install — build fails if manifest serves a different version than expected. Bump AGY_VERSION env var when upgrading. Ref #979
agy v1.0.4 requires OAuth via system keyring which can't be provisioned in CI without interactive browser flow.
d02c8fb to
e9a1297
Compare
E2E Verification on k3s (zf)Built ✅ Protobuf extraction (field 20 → field 1) works correctly with real agy v1.0.4 SQLite conversations on Linux. |
The shared artifact approach (upload/download-artifact@v4) is unreliable — smoke tests fail to find the artifact despite build-binary succeeding. Reverting to independent builds per job. See #986 for the proper fix (PREBUILT_BINARY build arg).
What
Antigravity CLI v1.0.4 changed conversation storage from protobuf (
.pb) to SQLite (.db). Ourconversation_snapshot()only scanned for.pbfiles, causing session binding to silently fail.Fix
Update the extension check to support both formats:
Also added a test that verifies
.dbdetection and confirms WAL sidecar files (.db-wal,.db-shm) are ignored.Testing
.dbfiles (no.pb)test_snapshot_detects_db_format_conversationsCloses #979
Thread: 1511492713411776663