Summary
geminiCli declares capabilities.resume: true, so on resume conciv sends only the latest user message — correct behaviour, since the harness is meant to hold the conversation. gemini-cli accepts the session load and keeps the same session ID, but never feeds the prior turns to the model.
Net effect: every gemini turn after the first loses all context in real conciv usage. packages/core/test/gemini-tanstack.it.test.ts has been catching this; it is skipped in CI (!process.env.CI) so it only shows up locally with the real CLI installed.
Evidence
| Check |
Result |
gemini initialize → agentCapabilities |
{"loadSession":true, ...} — so session/load is attempted, not skipped |
| Session ID across both turns |
identical (c2510aba-…) — the load succeeded, no silent fallback to newSession |
| gemini's own session file on disk |
contains PLUM42 — gemini did persist the history |
| Model reply on turn 2 |
"I do not have a token in my current context. This is the first message in our conversation." |
Same helper, claude harness (claude-tanstack.it.test.ts) |
passes in 9.8s |
So the conciv side is behaving correctly end to end:
acpChatConfig passes modelOptions: {sessionId} (packages/harness/src/_shared/acp.ts)
@tanstack/ai-acp calls connection.loadSession({sessionId, cwd, mcpServers}) when the agent advertises loadSession: true (src/session/acp-client.ts)
- gemini returns success and the ID is reused
- gemini does not restore the transcript into model context
Note that acp-client.ts swallows a failed load with a bare catch {} and falls back to a fresh session — but that is not what happens here; the matching session IDs prove the load succeeded.
Also worth noting: conciv spawns a new gemini --acp process per turn, so session/load must rehydrate from disk. The history is on disk, and turn two still started a new chat file.
Reproduce
Requires the real gemini CLI installed and authenticated:
cd packages/core && npx vitest run test/gemini-tanstack.it.test.ts
AssertionError: expected 'I do not have a record of a token in …' to contain 'PLUM42'
Unrelated gotcha found while diagnosing
If ~/.gemini/settings.json has security.auth.selectedType: "oauth-personal", every call fails with "This client is no longer supported for Gemini Code Assist for individuals" — Google discontinued that tier. Switching to "gemini-api-key" (with GEMINI_API_KEY set) gets past auth. This is separate from the resume bug above.
Options
- Set
resume: false for gemini so conciv replays the transcript preamble each turn. Fixes user-facing context loss; costs tokens per turn, and assertTurnAndResume would need a transcript-based variant for this harness.
- File upstream with gemini-cli and wait.
- Investigate whether
session/load needs additional params, or whether restoration works under a different auth mode or CLI flag.
Test is marked it.todo until this is resolved.
Summary
geminiClideclarescapabilities.resume: true, so on resume conciv sends only the latest user message — correct behaviour, since the harness is meant to hold the conversation. gemini-cli accepts the session load and keeps the same session ID, but never feeds the prior turns to the model.Net effect: every gemini turn after the first loses all context in real conciv usage.
packages/core/test/gemini-tanstack.it.test.tshas been catching this; it is skipped in CI (!process.env.CI) so it only shows up locally with the real CLI installed.Evidence
initialize→agentCapabilities{"loadSession":true, ...}— sosession/loadis attempted, not skippedc2510aba-…) — the load succeeded, no silent fallback tonewSessionPLUM42— gemini did persist the historyclaude-tanstack.it.test.ts)So the conciv side is behaving correctly end to end:
acpChatConfigpassesmodelOptions: {sessionId}(packages/harness/src/_shared/acp.ts)@tanstack/ai-acpcallsconnection.loadSession({sessionId, cwd, mcpServers})when the agent advertisesloadSession: true(src/session/acp-client.ts)Note that
acp-client.tsswallows a failed load with a barecatch {}and falls back to a fresh session — but that is not what happens here; the matching session IDs prove the load succeeded.Also worth noting: conciv spawns a new
gemini --acpprocess per turn, sosession/loadmust rehydrate from disk. The history is on disk, and turn two still started a new chat file.Reproduce
Requires the real
geminiCLI installed and authenticated:Unrelated gotcha found while diagnosing
If
~/.gemini/settings.jsonhassecurity.auth.selectedType: "oauth-personal", every call fails with "This client is no longer supported for Gemini Code Assist for individuals" — Google discontinued that tier. Switching to"gemini-api-key"(withGEMINI_API_KEYset) gets past auth. This is separate from the resume bug above.Options
resume: falsefor gemini so conciv replays the transcript preamble each turn. Fixes user-facing context loss; costs tokens per turn, andassertTurnAndResumewould need a transcript-based variant for this harness.session/loadneeds additional params, or whether restoration works under a different auth mode or CLI flag.Test is marked
it.todountil this is resolved.