hermes - 💡(How to fix) Fix ACP transport: assistant text content dropped when emitted alongside tool_calls (Copilot ACP / Opus 4.6)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

  1. The user sees noise that looks like an error

Fix Action

Fix / Workaround

  • Provider: copilot-acp (GitHub Copilot CLI ACP bridge)
  • Model: claude-opus-4.6
  • Trigger: any turn where the assistant emits both a tool call (terminal/write_file/patch) AND accompanying narrative text in the same message
  • Frequency: ~30-40% of multi-tool turns in my sessions today, fully reproducible across fresh sessions

Code Example

Model returned empty after tool calls — nudging to continue
Thinking-only response — prefilling to continue (1/2)

---

idx role       tool_calls  content_len
  3 assistant  True        0
  9 assistant  True        0
 24 assistant  True        0
 34 assistant  True        0
 40 assistant  True        0

---

--- msg 23 role=user ---
content: 'Do it.'

--- msg 24 role=assistant ---
content: ''
tool_calls: ['terminal']

--- msg 25 role=tool ---
content: '{"output": "ANTHROPIC_API_KEY=***...", "exit_code": 0}'
RAW_BUFFERClick to expand / collapse

Problem

When running on the copilot-acp provider with claude-opus-4.6, the assistant's text content is intermittently dropped if it appears in the same turn as structured tool_calls. Hermes receives the tool_calls block but content arrives empty, triggering the empty-response nudge:

Model returned empty after tool calls — nudging to continue
Thinking-only response — prefilling to continue (1/2)

The tool calls execute correctly and the nudge prompt recovers the conversation, but:

  1. Real reasoning/explanation text the model produced is lost
  2. The recovery turn wastes a full LLM round-trip
  3. The user sees noise that looks like an error

Reproduction

  • Provider: copilot-acp (GitHub Copilot CLI ACP bridge)
  • Model: claude-opus-4.6
  • Trigger: any turn where the assistant emits both a tool call (terminal/write_file/patch) AND accompanying narrative text in the same message
  • Frequency: ~30-40% of multi-tool turns in my sessions today, fully reproducible across fresh sessions

Not reproducible with single-tool-call turns or pure text turns.

Evidence — session transcript

From ~/.hermes/sessions/session_20260527_204254_fe4a76.json, message indices showing the pattern (assistant turns with tool_calls=true but content_len=0):

idx role       tool_calls  content_len
  3 assistant  True        0
  9 assistant  True        0
 24 assistant  True        0
 34 assistant  True        0
 40 assistant  True        0

Concrete example (messages 23-25):

--- msg 23 role=user ---
content: 'Do it.'

--- msg 24 role=assistant ---
content: ''
tool_calls: ['terminal']

--- msg 25 role=tool ---
content: '{"output": "ANTHROPIC_API_KEY=***...", "exit_code": 0}'

Message 24 should have contained narration like "Removing both keys now" alongside the terminal tool_call, but content was dropped before reaching the assistant message.

Suspected cause

The Copilot CLI ACP stream delivers tool_use and text content blocks separately. When the agent loop in agent/copilot_acp_client.py sees a tool_use block, the accumulated text block before it may not be flushed to the assistant message before the turn is finalized — only tool_calls survive into build_assistant_message().

Suggested fix

In copilot_acp_client.py, ensure that any accumulated text content is preserved on the assistant message alongside tool_calls before yielding the final assistant turn. Compare to how chat_completion_helpers.py handles mixed content+tool_calls responses from direct providers (Anthropic, OpenAI) where both fields coexist on the message.

Environment

  • Hermes: latest (config v23)
  • OS: macOS 15.3.1
  • Provider: copilot-acp
  • Model: claude-opus-4.6

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix ACP transport: assistant text content dropped when emitted alongside tool_calls (Copilot ACP / Opus 4.6)