Repository navigation
feat(acp): resume sessions and route side calls natively - #239
Merged
Merged
Conversation
anthonyhaussman
force-pushed
the
tone/feat/acp-native-feel
branch
from
December 1, 2026 07:02
cbb6fb4 to
dbcae8d
Compare
anthonyhaussman
marked this pull request as ready for review
December 1, 2026 17:57
Resume the stored agy session with session/resume when a new process starts and the fingerprint matches, so history is not replayed and the prompt cache survives. Falls back to session/new with full replay when resume fails or the last turn was interrupted. Assisted-by: Claude Opus 5.5
OpenCode tags each model request with a kind. Non-primary kinds such as title now use a throwaway agy session, so they never reset or pollute the stored primary conversation. Assisted-by: Claude Opus 5.5
Tool-call steps finished with zero usage, so the OpenCode context gauge and compaction stayed blind mid-turn. Use the latest usage_update context size as input tokens until agy reports usage. Assisted-by: Claude Opus 5.5
agy reports quota exhaustion as chat text. Drop its retry notices and turn the final give-up line into a rate_limited error. Assisted-by: Claude Opus 5.5
Image parts of OpenCode tool results now reach agy as MCP image content, and as ACP image blocks for late results. PDFs and other attachments become short text notes instead of type placeholders. Assisted-by: Claude Opus 5.5
OpenCode points the model at truncated tool output under its tool-output dir; agy asks permission for that read_file and the policy rejected it. Allow reads that resolve inside that dir. Assisted-by: Claude Opus 5.5
When agy ends a turn without finishing a provider-executed call, emit an error tool result so OpenCode does not fail the step. Assisted-by: Claude Opus 5.5
OpenCode 2.4 saves truncated shell output under its shell dir, not tool-output, so agy reads there were still rejected. Assisted-by: Claude Opus 5.5
agy rewrites one shared bridge schema cache on every tools/list, so title and compaction side calls listing no tools wiped the main session schemas. Side calls now list the last tool list and refuse every call. Assisted-by: Claude Opus 5.5
Title and compaction side calls now append a text-only instruction, so agy writes the summary OpenCode expects instead of looking up tool schemas. Assisted-by: Claude Opus 5.5
agy model ids now carry the thinking level, and selecting one sets thought_level, so low/medium/high variants were redundant. Assisted-by: Claude Opus 5.5
agy can end a turn with reasoning only, which OpenCode took as an empty answer and compaction rejected. Side calls retry once in a fresh agy session, other turns get an empty_reply error. Assisted-by: Claude Opus 5.5
OpenCode can send compaction with another agent's system prompt, so agy kept doing that agent's work. Compaction side calls now start the system prompt with a summary-only instruction. Assisted-by: Claude Opus 5.5
anthonyhaussman
force-pushed
the
tone/feat/acp-native-feel
branch
from
December 1, 2026 18:04
b96a101 to
24d062c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Stacked on #238 (
tone/feat/remove-google-agy).Merge that one first.
Session resume
Resume the stored agy session with
session/resumeafter a process restart, as long as the configuration fingerprint matches and the last turn finished cleanly.Only new messages are sent, so the prompt cache survives a restart: a live run resumed with 44,555 cached read tokens and no checkpoint replay.
If agy cannot resume the session, the provider opens a new one and replays the history.
Side calls
Requests whose
model.requestkind is notprimary, such as title generation, now run in a separate agy session that is closed afterwards.They no longer add turns to the user's main agy session.
Context use
Tool-call steps now report the latest agy
usage_updateas input tokens instead of zero.This lets OpenCode's context meter and compaction work during a turn.
Rate limit errors
agy's 429 retry lines are no longer streamed as chat text.
When agy gives up, the provider raises one
rate_limitederror and marks the turn interrupted.Tool-result images
Image tool results (
image-data,media, imagefile-data) now reach agy as MCP image content through the bridge, and as ACP image blocks when the result arrives late.Other inline files are still replaced by a text note.
Out of scope
Closing the agy session when an OpenCode session is deleted, and prewarming a session, are not included because OpenCode exposes no plugin hook for either.
The idle timer already stays alive while OpenCode runs tools.
The context limit stays at 1,048,576 tokens, which matches agy's reported size, and cost stays at $0.