You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: suppress non-English LLM responses before they reach the UI
Root cause: _call_provider emitted the llm_chunk JSON event immediately
after provider.complete() returned, before _agent_turn could run the
_has_non_english() check. Thai/Chinese responses were therefore sent to
the VS Code extension and displayed even when the correction turn later
produced an English reply.
Changes:
- Add defer_emit: bool = False param to _call_provider. When True, skip
the llm_chunk emission so the caller controls when content is surfaced.
- _agent_turn: set _defer_emit = not silent and self._json_events (only
applies in the VS Code bridge mode; interactive REPL unaffected).
- Emit llm_chunk from _agent_turn AFTER _has_non_english() passes (final
text responses) or after confirming content is English (tool-call partial
text). Non-English partial text on tool-call responses is silently dropped
instead of displayed.
- Remove the _iteration == 0 guard on the correction turn — non-English
responses on any iteration are now caught and re-prompted, not just the
first one.
Co-Authored-By: Oz <oz-agent@warp.dev>
0 commit comments