镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

fix(server): imported ACP history keeps the agent's thinking as reasoning - #6

Closed
alanjds wants to merge 1 commit into
only21mil:r9/g14-h1from
alanjds:fix/acp-import-reasoning
Closed

alanjds wants to merge 1 commit into
only21mil:r9/g14-h1from
alanjds:fix/acp-import-reasoning

Conversation

@alanjds

@alanjds alanjds commented Nov 10, 2026 •

Copy link
Copy Markdown

By humans for humans:

As my main agent is Hermes, I tried your PR pingdotgg#22155 for ACP usage. It worked good but the Thinking blocks appeared with no marks, text sibling to the tool call blocks but outside of a block.

With that patch over your PR, the Thought blocks appears correctly like the Claude Code sessions at least:

Image

Feel free to merge this before the upstream merge of #22155 or as a follow-up. Just let me know if possible.

Problem

With pingdotgg#22155, an imported ACP session shows its native history, but the agent's thinking comes in as ordinary assistant replies. The ACP adapter replays agent_thought_chunk updates into its snapshot as role: "assistant" messages, and the importer copies every non-empty assistant message. The pingdotgg#22155 description lists this under "Not checked" ("loaded thought chunks would import as assistant messages").

Seen with Hermes Agent (v0.20.5), which replays thought chunks on session/load: the reasoning text appeared as chat replies inside the "Worked for" group, not as thinking.

Change

  • provider-acp adapter.ts: the snapshot state records which replayed messages came from thought chunks (reasoningKeys, optional so existing resets are unchanged), and readThreadSnapshot returns them as reasoningMessageIds.
  • provider-core ProviderAdapter.ts: ProviderAdapterV2ThreadSnapshot gets the optional reasoningMessageIds. It is a server-side type, nothing crosses the wire.
  • AgentSessionImporter.ts: a snapshot message listed there is written as a run-less reasoning turn item (no conversation message), same item type live reasoning uses. User and assistant messages are unchanged.

Other adapters don't set reasoningMessageIds, so their import is unchanged.

Verification

  • AgentSessionImporter.test.ts: the existing "copies native session history..." case now includes a reasoning message; the messages view still shows only the user and assistant messages, and the activity view shows the reasoning item with runId: null.
  • AcpAdapterV2.test.ts: the existing plan-replay-boundary case now replays a thought chunk and checks reasoningMessageIds points at it.
  • vp test run on those two files passes (109 tests); vp fmt --check on the five changed files is clean. I did not run vp run check:changed, knip or the web tests.
  • Manual, real agent: built this branch's server plus the fix(server): imported ACP sessions show their native history pingdotgg/t3code#22155 merge on a separate port with an empty database, imported a real Hermes session, and opened it in a desktop browser and on Android. Before this change the thinking showed as assistant replies; after it, the "Worked for" group shows a "Thought" row with the reasoning text. Screenshot available on request.

Not checked: other ACP agents that replay thoughts, fork behaviour of an imported thread with reasoning items, and long histories. Imported reasoning carries the import time, like the other imported messages.

Related, not changed here: the replayed first user message includes T3's injected <t3_code_instructions> block, as the bridge supplies it (see pingdotgg#24465).

🤖 Generated with Claude Code

…ning

The ACP adapter stores replayed thought chunks as assistant messages, so an
imported thread showed them as replies grouped under "Worked for". The
snapshot now lists which messages are thoughts and the importer writes them
as run-less reasoning items.

Co-Authored-By: Alan Justino <alan.justino@yahoo.com.br>
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M labels Nov 10, 2026
@alanjds
alanjds marked this pull request as ready for review November 10, 2026 16:50
@only21mil

Copy link
Copy Markdown
Owner

Note

🤖 Opus 5.5 replying on behalf of Victor.

Thanks @alanjds, your fix is now on pingdotgg#22155 as pingdotgg/t3code@061f6e9d65 and pingdotgg/t3code@54f92235c3, with you as co-author on both, so I'm closing this in favour of those commits.

@only21mil only21mil closed this Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants