Repository navigation
Conversation
…odel (#480) Resume one agy conversation per logical chat instead of re-flattening the full history into a fresh CLI process per request. Conversation ids are learned from the CLI's own output (json: top-level conversation_id; stream-json: result.conversation_id) and resumed via --conversation with only the new turn(s). Entries {conversationId, fedCount, fedHashes, lastResponseHash, lastUsed} are persisted to warm-sessions.json next to endpoint.json, LRU 64 / 2h TTL, and only used when the request history is a strict continuation of what was fed. Any resume failure - non-zero exit, or the CLI's silent 'conversation not found' degradation - falls back to a full-history fresh run and still answers.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d5792d7680
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (messages[idx]?.role === 'assistant') { | ||
| if (entry.lastResponseHash && hashText(messageText(messages[idx])) !== entry.lastResponseHash) { | ||
| return { key, mode: 'fresh' }; | ||
| } | ||
| idx++; | ||
| } |
There was a problem hiding this comment.
Reject warm continuation when the assistant echo is missing
After a single-message request [user A] produces response X, a subsequent request [user A, user B] passes the prefix check and resumes with B because the assistant echo is optional here. The resumed conversation still contains X even though the caller's supplied history omits it, so the answer is generated from a different history than requested. Previously, the initial single-message request did not populate the automatic session cache, so this follow-up ran with the supplied full history. Require the matching assistant echo before reusing the conversation; otherwise use a fresh run.
Useful? React with 👍 / 👎.
| if (resumeNotFound && targetConvId) { | ||
| // Streamed answer came from a degraded fresh conversation | ||
| // that never saw the history: do not key it as fed. | ||
| invalidateWarm(warmPlan.key); | ||
| } |
There was a problem hiding this comment.
Report streamed unknown-conversation degradation as an error
When a warm streaming resume emits the recognized conversation ... not found warning, produces text, and exits zero, the retry is skipped because hasOutput is true. This branch only invalidates the cache; execution then bypasses the nonzero-exit error handler and sends finish_reason: "stop" for an answer generated without the previous history. I reproduced this with a stub emitting that warning, a text delta, and exit zero. Since the streamed text cannot be retracted, terminate with an SSE error rather than reporting successful completion.
Useful? React with 👍 / 👎.
| const warmPlan = (!sessionInfo.conversationId && !sessionInfo.explicit) | ||
| ? planWarmRequest(body.messages, fullName) | ||
| : { key: null, mode: 'fresh' }; |
There was a problem hiding this comment.
Keep user-keyed sessions out of the automatic warm cache
On the first request with body.user, there is no cached conversation yet, so this condition enables warm tracking and registers the resulting conversation in both stores. Later requests for that user resume through sessionStore without updating or invalidating its warm entry. Consequently, after user Bob sends [A] → X and then [A, X, B], an anonymous request [A, X, C] passes the stale warm-prefix check and resumes Bob's conversation containing B, although B is absent from its supplied history. I reproduced this sequence with a stateful stub. Previously, user-keyed sessions never populated the automatic cache. Exclude requests with a user session key from warm tracking, or synchronize warm metadata whenever that conversation is resumed through the legacy store.
Useful? React with 👍 / 👎.
|
SHELVED by Drew's direction (2026-10-24): Antigravity is being consolidated to ONE provider fleet-wide (antigravity-ls, the warm daemon route); antigravity-agy is being disabled on both machines (kept in config as fallback). The warm conversation-reuse work here is complete but is NOT to be merged or shipped. Branch retained for reference; closing this PR without merging to shelve it. Part of the #480 warm-session program — codex (resume + app-server evaluation), muse (serve/MSP), design/clef keep-alive proceeded separately. |
What
bin/agy-proxy.mjsspawned a freshagyprocess per request and re-flattened the full conversation. It now reuses one agy conversation per logical chat:sha256(system prompt + first user message + resolved model){conversationId, fedCount, fedHashes, lastResponseHash, lastUsed}, persisted towarm-sessions.jsonnext toendpoint.json; LRU 64 entries / 2h TTL;warmSessionsadded to/health.--conversation <id>.warning: conversation "<id>" not foundon stderr, exit 0, fresh conversation with only the new turn — probed against agy 1.4.1) falls back to a full-history fresh run and still answers. Stream mode keeps the agy-proxy: failed agy run reported as successful 'stop' — stream handler never checks the exit code, non-stream masks failure when partial output exists #678 rule that already-streamed partial output cannot be retried.How conversation ids are learned (probed, agy 1.4.1)
--output-format json→ top-level{"conversation_id": "<id>", ...}--output-format stream-json→{"event":"result","result":{"conversation_id": "<id>", ...}}--conversation <id>resumes;--continuealso exists but is global most-recent state, so it is not used for keyed reuse.Tests
node --test bin/agy-proxy.test.mjs— 9/9 pass: the 5 existing #678 failure-detection tests plus 4 new #480 tests (continuation sends only the new turn in both modes, tampered/repeated history → fresh, failed warm resume → fresh answer, warm store persists across a proxy restart).Deployment / measurement note
Sandbox + laptop deployment and before/after timings are being completed alongside this PR; the sandbox's agy is currently returning
Authentication required(no~/.gemini/oauth_creds.jsonpresent), so live timings there measure the auth-failure path until re-login. This PR does not touchopencode.jsoncor any other proxy.Need help on this PR? Tag
@codesmith-botwith what you need.