Related: microsoft/agent-host-protocol#352 and #327067
Runtime shell output is streamed through one agenthost-terminal://shell/<session>/<toolCall> output-only resource per shell tool call. These are not PTYs and do not create terminal processes.
The workbench subscription normally goes away when the turn ends, but the host keeps the completed resource and its buffered output in _outputTerminals / NonPtyShellTerminalStreams._streams until the Copilot session is idle-released, deleted, or shut down. For a long-lived open session, completed resources grow with every shell call.
AHP now carries the final preview, exitCode, and truncated state on TerminalCommandResult, and completed history already knows how to render that static result. Once the final result has been published, the live output channel should no longer be needed.
Would like the lifecycle to be:
- create a unique output resource while a shell call is running;
- stream through it while live;
- publish the final terminal result;
- switch completed rendering to the static result;
- unsubscribe and dispose the output resource/remove its stream entry.
For isPty: false, completed history should not try to revive or recreate a terminal. Calls without authoritative completion metadata, such as a background shell handoff, should remain alive until a later completion signal or normal session teardown.
Related: microsoft/agent-host-protocol#352 and #327067
Runtime shell output is streamed through one
agenthost-terminal://shell/<session>/<toolCall>output-only resource per shell tool call. These are not PTYs and do not create terminal processes.The workbench subscription normally goes away when the turn ends, but the host keeps the completed resource and its buffered output in
_outputTerminals/NonPtyShellTerminalStreams._streamsuntil the Copilot session is idle-released, deleted, or shut down. For a long-lived open session, completed resources grow with every shell call.AHP now carries the final
preview,exitCode, andtruncatedstate onTerminalCommandResult, and completed history already knows how to render that static result. Once the final result has been published, the live output channel should no longer be needed.Would like the lifecycle to be:
For
isPty: false, completed history should not try to revive or recreate a terminal. Calls without authoritative completion metadata, such as a background shell handoff, should remain alive until a later completion signal or normal session teardown.