Skip to content

fix(pi-cli): recover assistant text from message updates#930

Closed
christso wants to merge 1 commit intomainfrom
fix/922-pi-cli-azure-empty-content
Closed

fix(pi-cli): recover assistant text from message updates#930
christso wants to merge 1 commit intomainfrom
fix/922-pi-cli-azure-empty-content

Conversation

@christso
Copy link
Copy Markdown
Collaborator

@christso christso commented Apr 4, 2026

Closes #922

Summary

  • recover assistant content from pi message_update streaming events when agent_end.messages[].content is empty
  • keep the existing message_end fallback and add regression coverage for the streamed-delta case

Red

  • On main, running a synthetic pi JSON stream with message_update text deltas and an empty agent_end assistant message returned an assistant message with no content
  • Repro command used locally:
    bun --eval 'import { _internal } from "./packages/core/src/evaluation/providers/pi-cli.ts"; /* synthetic message_update + empty agent_end */'\n\n## Green\n- The same synthetic stream now returns assistant content 2 + 2 = 4\n- Regression test added in packages/core/test/evaluation/providers/pi-cli-tool-extraction.test.ts\n\n## Verification\n- bun test packages/core/test/evaluation/providers/pi-cli-tool-extraction.test.ts\n- bun test packages/core/test/evaluation/providers/targets.test.ts --test-name-pattern "pi-cli with azure subprovider and base_url"\n- bunx biome check packages/core/src/evaluation/providers/pi-cli.ts packages/core/test/evaluation/providers/pi-cli-tool-extraction.test.ts\n- pre-push hook passed: build, typecheck, lint, test, validate:examples\n

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying agentv with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7ca47dc
Status: ✅  Deploy successful!
Preview URL: https://389ff895.agentv.pages.dev
Branch Preview URL: https://fix-922-pi-cli-azure-empty-c.agentv.pages.dev

View logs

@christso
Copy link
Copy Markdown
Collaborator Author

christso commented Apr 4, 2026

Closing because the reported pi-azure bug did not reproduce as a real Azure E2E failure in this environment. The parser edge case was reproducible, but not the user-facing red path from #922. I verified on main and on this branch with a real Azure-backed eval, and both passed. I’m filing a separate issue for the real Azure failure reproduced on main.

@christso christso closed this Apr 4, 2026
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.

pi-cli azure: empty assistant content in agent_end JSONL

1 participant