Skip to content

fix(server): keep assistant text contiguous across background tool updates - #16

Merged
Fryuni merged 1 commit into
mainfrom
t3code/fix-ohmypi-output-chunking
Sep 17, 2026
Merged

Fryuni merged 1 commit into
mainfrom
t3code/fix-ohmypi-output-chunking

Conversation

@Fryuni

@Fryuni Fryuni commented Sep 17, 2026

Copy link
Copy Markdown
Owner

What Changed

In the ACP session runtime, tool_call_update events no longer close the active assistant text segment. Only a new tool_call marks a boundary, since updates to an existing (background) tool can arrive between chunks of a single assistant message. Added a mock-agent mode (T3_ACP_EMIT_ASSISTANT_DURING_TOOL_UPDATES) and a driver test that streams assistant chunks interleaved with background tool progress and asserts the text stays contiguous.

Why

Background tools (e.g. long-running CI checks) emit progress updates while the model is still streaming its reply. Treating every update as a segment boundary split one assistant message into fragments mid-token ("fa871" / "7" / "a68."), producing broken markdown and disjointed output for OhMyPi and other ACP-based providers. Updates to an existing tool call don't start a new speaker turn, so they shouldn't end the current message.

UI Changes

Not applicable (server-side streaming behavior; no UI code changed).

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

- ACP tool_call_update no longer closes the active assistant segment; only a new tool_call does
- Extend acp-mock-agent with a mid-tool assistant text scenario and cover it in OhMyPiDriver tests
Copilot AI lite review requested due to automatic review settings September 17, 2026 18:15
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-17T18:18:04.615097Z 1eeb7cf PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved blocking issues were identified.

Pull request overview

Updates ACP streaming to keep assistant text contiguous across background tool progress updates.

Changes:

  • Preserve assistant segments across tool_call_update events.
  • Add mock-agent interleaving behavior.
  • Add regression coverage for contiguous output.
File summaries
File Description
apps/server/src/provider/Drivers/OhMyPiDriver.test.ts Verifies contiguous assistant text.
apps/server/src/provider/acp/AcpSessionRuntime.ts Adjusts assistant segment boundaries.
apps/server/scripts/acp-mock-agent.ts Adds interleaved tool-update simulation.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Fryuni
Fryuni merged commit 6b05944 into main Sep 17, 2026
9 checks passed
@Fryuni
Fryuni deleted the t3code/fix-ohmypi-output-chunking branch September 17, 2026 18:21
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.

2 participants