Skip to content

fix: emit completed messages when providers omit deltas - #500

Open
quabug wants to merge 1 commit into
agentclientprotocol:mainfrom
quabug:fix/completed-message-fallback
Open

fix: emit completed messages when providers omit deltas#500
quabug wants to merge 1 commit into
agentclientprotocol:mainfrom
quabug:fix/completed-message-fallback

Conversation

@quabug

@quabug quabug commented Sep 11, 2026

Copy link
Copy Markdown

Some OpenAI-compatible Responses providers, including Volcengine Ark, deliver final text without item/agentMessage/delta. Codex app-server still emits item/started and item/completed for an agentMessage carrying the full text, but codex-acp currently ignores both. ACP clients receive reasoning and a successful end_turn with no final message.

Track agent-message item IDs that emitted deltas. On item/completed, retain the current no-op for those streamed messages; otherwise emit the completed item's non-empty text once, including its phase metadata.

Validation:

  • npm run typecheck
  • npx vitest run --no-file-parallelism src/__tests__/CodexACPAgent/agent-message-events.test.ts
  • npm run build
  • Real Ark deepseek-v4-flash ACP turn: before this change, only the thought event arrived; after this change, the client received exactly one final agent_message_chunk containing ARK_ACP_RAW_OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant