Skip to content

run agents: open a turn's session in the agent's own CLI, or copy its id - #75

Merged
endrix merged 1 commit into
mainfrom
feat/open-run-agent-session
Oct 14, 2026
Merged

endrix merged 1 commit into
mainfrom
feat/open-run-agent-session

Conversation

@endrix

@endrix endrix commented Oct 14, 2026

Copy link
Copy Markdown
Owner

Follow-up to #74, for agents inside a run. The runtime side is huawei-csl/wfpy#49, which is merged: each firing reports session: {id, connector, cwd} on its agent.message.end event.

  • Transcript: RunAgentStreamActionHandler attaches the session to that firing's turn part (liveAgentSession reads it). Each turn keeps its own session.
  • Run-agent view: each finished turn whose firing reported a session gets two buttons in its header: open this turn's session in the agent's own CLI and copy this turn's session id.
  • Host: new chat.openAgentSession and chat.copyAgentSession messages.
    • The resume command comes from the workspace's connectors files via the new ChatRuntimeConfig.connectorResume, built from the profile's acpConnector, so a project's custom connector or a cleared resume is respected. Without that hook, the built-in connectors' commands are used.
    • No connector (an explicit command line) → the id is copied.
    • The terminal opens in the session's directory, using native-session.ts from chat: open the chat's session in the agent's own CLI, or copy its id #74.

Tests:

  • run-agents-session.test.ts: the session lands on its turn, per turn; no session; parsing.
  • chat-runtime-native-session.test.ts: the connector from the workspace files, the fallback to built-in commands, copy without a connector, copy.

https://claude.ai/code/session_01N33eMqpCzhDs8HDNez3Yja

A runtime may report on a firing's `agent.message.end` the session it talked
to: `session: {id, connector, cwd}`. The run-agent transcript keeps it on
that firing's turn, and the turn's header offers the same two buttons as the
chat's session: open it in the agent's CLI (a terminal in the session's
directory) and copy its id.

The host resolves the named connector's `resume` template as the workspace's
connectors files declare it (`connectorResume`, from the profile's
`acpConnector`), falling back to the known connectors' without them. No
connector named -- an explicit command line -- and the id is copied.

Claude-Session: https://claude.ai/code/session_01N33eMqpCzhDs8HDNez3Yja
@endrix
endrix merged commit 3bdc2e9 into main Oct 14, 2026
1 check passed
@endrix
endrix deleted the feat/open-run-agent-session branch October 14, 2026 08:50
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.

1 participant