acp: Fix provider-owned terminal lifecycle (#64544)

Provider terminal metadata creates a display buffer, not a client-owned
process. These terminals previously entered the process-completion path,
which completed immediately when no local task existed and cached empty
output. Provider exit status was also discarded.

- Distinguish client-owned processes from provider-owned display
terminals, including headless processes that use the same lower-level
display renderer.
- Complete display terminals on provider exit and retain ACP exit
codes/signals. Duplicate creation and exit events preserve identity and
completion; late output refreshes cached content without changing exit
time or status.
- Refresh tool-card metadata when provider completion arrives without
another tool update.
- Show Stop only for client-owned processes and avoid treating display
terminals as background processes when their tool completes.
- Preserve the full unsigned exit-code range without manufacturing `-1`
for signal-only exits.

Process wait/kill behavior, PTY release, and sandbox cleanup remain
intact. Header rendering continues to use cached metadata rather than
extracting terminal contents.

Release Notes:

- acp: Fixed premature completion and incorrect exit-status reporting
for external-agent terminals, and removed Stop controls from terminals
managed by the agent.
656e3aed84Ben Brandt committed on 9/21/2026, 12:59:56 PM· committed by GitHubparentaf431ae
8 files changedLine totals unavailable