Skip to content

fix(acp): backfill missing text chunks from part updates#1

Merged
nkosi23 merged 1 commit intodevfrom
codex/fix-output-truncation-in-acp-agent-plugin
Mar 1, 2026
Merged

fix(acp): backfill missing text chunks from part updates#1
nkosi23 merged 1 commit intodevfrom
codex/fix-output-truncation-in-acp-agent-plugin

Conversation

@nkosi23
Copy link
Owner

@nkosi23 nkosi23 commented Mar 1, 2026

Motivation

  • Some ACP clients/plugins (e.g. JetBrains/GLM plugin) can miss or delay message.part.delta delivery, causing assistant output to appear truncated until a later refresh.
  • The agent needs to emit any missing assistant/reasoning chunks when only message.part.updated arrives so ACP clients receive output incrementally.

Description

  • Added textSnapshots: Map<string,string> to packages/opencode/src/acp/agent.ts to track the last-seen text for each part id.
  • Handle message.part.updated for text and reasoning parts by computing the missing delta via textDelta(id, next) and emitting an agent_message_chunk or agent_thought_chunk containing only the new text.
  • Update message.part.delta handling to keep textSnapshots in sync (store full part text) so delta and updated events don’t cause duplicate emission.

Testing

  • Ran typecheck with bun run typecheck which failed in this environment because tsgo is not installed.
  • Ran scoped test command bun test src/acp --timeout 30000 which executed successfully but matched no test files.
  • Ran full test suite bun test --timeout 30000 which failed in this environment due to missing local dependencies (e.g. zod, remeda, hono) and registry access errors, so CI-style tests could not be completed here.

Codex Task

@nkosi23 nkosi23 merged commit 54ec085 into dev Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant