acp_thread: Add shared structured plan state (#64884)

Give structured agent plans one retained source record per identity and
a separate selected plan, while preserving the existing single-panel UI
and v1 behavior.

- Adapt complete v1 snapshots into shared SDK-v2 entry values before
mutating state. Retain entry metadata, plan-content metadata, and outer
update metadata at their respective levels.
- Add a keyed structured-items entrypoint without synthetic protocol
IDs. A new ID or meaningful ordered task change selects/reopens the
plan; identical and metadata-only snapshots do not switch the panel or
undo dismissal.
- Make Clear Plan dismiss presentation without deleting keyed source.
Keep v1's clear/repopulate behavior and restrict next-turn
completed-entry pruning to the legacy record.
- Reuse Markdown entities within each plan. Preserve unknown v2
statuses/priorities; distinguish cancellation from successful
completion.
- Observe ordinary thread notifications so status-only, selection-only,
and empty-plan changes repaint without depending on a Markdown update.

Release Notes:

- acp: Improved agent plan state handling and panel refreshes.
72d28c32c2Ben Brandt committed on 9/28/2026, 4:59:30 PM· committed by GitHubparent3135cdf
3 files changedLine totals unavailable