Skip to content

Add deterministic source-pane slash commands - #607

Open
Kai Tao (vanzue) wants to merge 11 commits into
mainfrom
dev/vanzue/deterministic-pane-slash-commands
Open

Add deterministic source-pane slash commands#607
Kai Tao (vanzue) wants to merge 11 commits into
mainfrom
dev/vanzue/deterministic-pane-slash-commands

Conversation

@vanzue

@vanzue Kai Tao (vanzue) commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • make /command and /cmd produce deterministic Run, Insert, and Adjust command cards bound to the helper source pane
  • keep command refinement on the same snapshotted pane and represent revisions as a maximum two-level history tree
  • add $ direct source-pane execution while rejecting model-authored terminal action proposals during command preparation
  • normalize pane session IDs and retain an internal pane catalog for source metadata and exact target invalidation
  • integrate with ACP metadata-driven slash completion and virtualized chat history
  • remove the earlier @ pane picker, persistent pane targeting, and picker-driven Agent chip behavior

Validation

  • cargo fmt --check --manifest-path tools/wta/Cargo.toml
  • locale key parity across all 89 locales
  • cargo test --target x86_64-pc-windows-msvc --manifest-path tools/wta/Cargo.toml (1750 passed)
  • cargo build --target x86_64-pc-windows-msvc --manifest-path tools/wta/Cargo.toml
  • full Debug Terminal package build, deployment, and live launch
image

Add persistent pane targeting, deterministic command and delegate workflows, direct terminal execution, and Agent chip feedback.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9f85754b-11fa-4f92-abb0-c7a24d695491
Copilot AI lite review requested due to automatic review settings August 12, 2026 10:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds deterministic, pane-targeted agent workflows to the Intelligent Terminal stack by publishing a per-tab pane catalog (with stable pane/session identifiers) and wiring new “pane mention” + delegate UX through WTA’s TUI and localization.

Changes:

  • Adds new WTA TUI popups for pane targeting (@) and delegate destination selection, and wires them into the main layout.
  • Extends pane context metadata (cached pane details) and command parsing to support /command (/cmd) and /delegate, including a narrow @-picker trigger.
  • Publishes pane catalog updates from TerminalApp (pane catalog event + generation tracking) and updates pane SessionId extraction to support cataloging.

Reviewed changes

Copilot reviewed 117 out of 117 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tools/wta/src/ui/pane_popup.rs New pane-target picker popup UI rendering.
tools/wta/src/ui/delegate_popup.rs New delegate destination picker popup UI rendering.
tools/wta/src/ui/mod.rs Registers/exports new popup modules and state types.
tools/wta/src/ui/layout.rs Renders the new pane/delegate popups when active.
tools/wta/src/protocol/acp/prompt_builder.rs Updates tests for added PaneContext.cached_source field.
tools/wta/src/pane_context.rs Adds cached pane metadata and stores it in PaneContext.
tools/wta/src/coordinator.rs Makes OpenTarget copyable and refactors validation match formatting.
tools/wta/src/commands.rs Adds /command + /delegate, /cmd alias handling, and pane-picker prefix detection.
tools/wta/src/app/input_edit.rs Opens/closes pane picker based on the new prefix detection during input refresh.
tools/wta/src/app/autofix.rs Populates PaneContext.cached_source (None) and refactors formatting.
tools/wta/src/app_contracts/event.rs Adds DelegateDestinationReady event to app contract.
tools/wta/prompts/prepare-pane-input.md New prompt template for deterministic command-card preparation.
tools/wta/prompts/prepare-delegate-prompt.md New prompt template for delegate prompt preparation.
tools/wta/locales/en-US.yml Adds localized strings for pane picker, delegate picker, and delegate button.
tools/wta/locales/en-GB.yml Adds localized strings for pane picker, delegate picker, and delegate button.
tools/wta/locales/zh-TW.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/zh-CN.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/vi-VN.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/uz-Latn-UZ.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/ur-PK.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/uk-UA.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/tt-RU.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/tr-TR.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/th-TH.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/sv-SE.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/sr-Latn-RS.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/sq-AL.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/sl-SI.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/sk-SK.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/ru-RU.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/ro-RO.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/quz-PE.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/pt-PT.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/pt-BR.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/pl-PL.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/nn-NO.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/nb-NO.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/nl-NL.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/ne-NP.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/mt-MT.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/ms-MY.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/mr-IN.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/mk-MK.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/mi-NZ.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/lv-LV.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/lt-LT.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/lb-LU.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/ko-KR.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/kk-KZ.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/ka-GE.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/ja-JP.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/it-IT.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/is-IS.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/id-ID.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/hy-AM.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/hu-HU.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/hr-HR.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/hi-IN.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/he-IL.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/gu-IN.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/gl-ES.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/ga-IE.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/fr-FR.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/fr-CA.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/fi-FI.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/fa-IR.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/eu-ES.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/et-EE.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/es-MX.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/es-ES.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/el-GR.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/de-DE.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/da-DK.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/cy-GB.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/cs-CZ.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/ca-ES.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/ca-Es-VALENCIA.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/bs-Latn-BA.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/bn-IN.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/bg-BG.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/az-Latn-AZ.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/as-IN.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/ar-SA.yml Adds localized strings for pane/delegate picker flows and buttons.
tools/wta/locales/af-ZA.yml Adds localized strings for pane/delegate picker flows and buttons.
src/cascadia/TerminalApp/TerminalPage.h Tracks per-tab pane-catalog generations and adds catalog publishing helper.
src/cascadia/TerminalApp/Tab.h Adds pane-catalog change event to notify listeners.
src/cascadia/TerminalApp/Pane.cpp Updates pane SessionId retrieval to follow the terminal control/connection path.
Suppressed comments (1)

tools/wta/locales/sr-Latn-RS.yml:86

  • This command summary still contains placeholder markers (__PH0__ __PH1__) instead of the intended locked tokens (/delegate <intent>).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tools/wta/locales/ug-CN.yml
Comment thread tools/wta/locales/or-IN.yml Outdated
Comment thread tools/wta/locales/tt-RU.yml Outdated
Comment thread tools/wta/locales/sr-Latn-RS.yml Outdated
Comment thread tools/wta/locales/sr-Latn-RS.yml Outdated
@github-actions

This comment has been minimized.

Kai Tao (vanzue) and others added 5 commits August 23, 2026 21:48
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Generate host-owned command cards, support pane-bound Adjust revisions, normalize pane GUIDs, and render a two-level revision history.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 84713e5f-b459-48ea-9f39-7eb4f441a0ec
Integrate metadata-driven ACP slash completion and virtualized chat history while preserving deterministic pane-bound command refinement.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 84713e5f-b459-48ea-9f39-7eb4f441a0ec
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 84713e5f-b459-48ea-9f39-7eb4f441a0ec
Copilot AI review requested due to automatic review settings August 25, 2026 11:33
@vanzue Kai Tao (vanzue) changed the title Add deterministic pane-targeted agent actions Add deterministic source-pane slash commands Aug 25, 2026
Comment thread doc/specs/deterministic-pane-actions.md Fixed
Comment thread tools/wta/src/app.rs Fixed
Comment thread tools/wta/src/app_tests.rs Fixed
Comment thread tools/wta/src/protocol/acp/prompt.rs Fixed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 119 out of 119 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

tools/wta/locales/sr-Latn-RS.yml:88

  • commands.delegate.summary contains unresolved localization placeholder tokens "PH0 PH1" instead of the intended locked literal "(/delegate )" (as used in en-US and other locales). This will show broken help text to users; replace the placeholder tokens with the correct literal, preserving the locked /delegate and tokens.

Comment thread tools/wta/locales/sr-Latn-RS.yml
@github-actions

This comment has been minimized.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 84713e5f-b459-48ea-9f39-7eb4f441a0ec
Copilot AI review requested due to automatic review settings August 26, 2026 03:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 120 out of 120 changed files in this pull request and generated no new comments.

Suppressed comments (4)

Previously missed (4) — in code that hasn't changed since the last review.

tools/wta/src/ui/delegate_popup.rs:18

  • Avoid hard-coding the popup content height (2). If the delegate options list changes, the popup height will silently become incorrect. Derive the row count from the item list so the popup stays correct when entries are added/removed.
    tools/wta/locales/id-ID.yml:79
  • This button label has an extra leading space before the opening bracket, which will render inconsistently with the other recommendation buttons (e.g. "[ Jalankan perintah ]").
    tools/wta/locales/tt-RU.yml:96
  • This button label is missing the closing bracket "]", so it will render as a malformed button compared to the other recommendation actions.
    tools/wta/src/commands.rs:563
  • The second assert is redundant with the exact-registry equality check above, and its message references ACP behavior even though this test only inspects the host REGISTRY. This can mislead future readers when it fails.

Comment thread tools/wta/src/protocol/acp/prompt.rs Fixed
@github-actions

This comment has been minimized.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 84713e5f-b459-48ea-9f39-7eb4f441a0ec
Copilot AI review requested due to automatic review settings August 26, 2026 03:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 120 out of 120 changed files in this pull request and generated no new comments.

Suppressed comments (6)

Previously missed (5) — in code that hasn't changed since the last review.

tools/wta/src/ui/delegate_popup.rs:18

  • Avoid hardcoding the popup content height ("2") separately from the item list. If the list changes, the popup height will become incorrect and the widget may clip. Compute the content rows from items.len() and derive the popup area from that.
    tools/wta/locales/zh-TW.yml:60
  • Popup titles in this file use surrounding spaces (e.g. " / 命令 ") so the title has padding against the border. delegate_picker.title lacks that padding and will render tighter than the other popups.

This issue also appears on line 74 of the same file.
tools/wta/locales/tt-RU.yml:97

  • This button label has an extra leading space before [ and is missing the standard padding spaces inside the brackets. This will render misaligned compared to the other button labels in this locale.
    tools/wta/locales/id-ID.yml:80
  • This button label has an extra leading space before [ and an extra trailing space before ]. Use the same bracket-padding format as the other button labels so the UI stays aligned.
    tools/wta/locales/es-MX.yml:80
  • This button label is missing the standard space after [ (compare with [ Ejecutar comando ]). Keeping bracket padding consistent avoids visual jitter in the recommendations panel.
recommendations.button_run_command: "[ Ejecutar comando ]"
recommendations.button_send_to_delegate: "[Enviar a delegado ]"
recommendations.button_insert_in_terminal: "Insertar en terminal"

tools/wta/locales/zh-TW.yml:76

  • This button label is missing the usual spaces inside the brackets (compare with [ 執行命令 ]). Without consistent padding it will look misaligned in the recommendations list.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 722ef254-e7c1-40c7-ab0c-8f667a9de98b
Copilot AI review requested due to automatic review settings August 27, 2026 08:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 120 out of 120 changed files in this pull request and generated no new comments.

Suppressed comments (2)

Previously missed (1) — in code that hasn't changed since the last review.

tools/wta/locales/tt-RU.yml:90

  • This summary string has a leading space inside the quotes, which will render as unintended indentation in the UI/help list. Remove the leading whitespace so it matches the other command summary entries.

This issue also appears on line 96 of the same file.

tools/wta/locales/tt-RU.yml:96

  • This button label has an extra leading space before the opening bracket and is missing the usual inner padding used by the other bracketed button labels. This will render misaligned compared to recommendations.button_run_command.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 722ef254-e7c1-40c7-ab0c-8f667a9de98b
Copilot AI review requested due to automatic review settings August 27, 2026 08:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 120 out of 120 changed files in this pull request and generated 6 comments.

delegate_picker.intent_required: "[[ЛИНЕ3]]Опишите посао за делегирање."
delegate_picker.not_configured: "[[ЛИНЕ6]]Није конфигурисан ниједан агент за делегирање."
delegate_picker.no_parent_pane: "[[ЛИНЕ5]]Није доступно радно окно за раздвајање."
delegate_picker.launch_failed: "[[ЛИНЕ4]]Није могуће покренути делегата: __ПХ2__"
commands.command.summary: "Create a terminal command card from an intent (/command <intent>)" # {Locked="/command","<intent>"}
command_card.intent_required: "Describe the terminal command you want Copilot to prepare."
command_card.adjustment_required: "Опишите како желите да прилагодите команду терминала."
commands.delegate.summary: "[[ЛИНЕ1]]Припремите задатак и отворите делегираног агента (__ПХ0__ __ПХ1__)"
# {Locked="Enter","Esc","↵","↑","↓","←","→"} - key names and Return-key glyph, do not translate
recommendations.nav_hint: "(↑ ↓ за навигацију • ← → за пребацивање дугмади • Enter за избор • Esc за отказивање)"
recommendations.button_run_command: "[ Покрени команду ]"
recommendations.button_send_to_delegate: "[[ЛИНЕ14]][ Пошаљи делегату ]"
delegate_picker.intent_required: "[[ЛИНЕ3]]Опишите посао за делегирање."
delegate_picker.not_configured: "[[ЛИНЕ6]]Није конфигурисан ниједан агент за делегирање."
delegate_picker.no_parent_pane: "[[ЛИНЕ5]]Није доступно радно окно за раздвајање."
delegate_picker.launch_failed: "[[ЛИНЕ4]]Није могуће покренути делегата: __ПХ2__"
commands.command.summary: "Create a terminal command card from an intent (/command <intent>)" # {Locked="/command","<intent>"}
command_card.intent_required: "Describe the terminal command you want Copilot to prepare."
command_card.adjustment_required: "Опишите како желите да прилагодите команду терминала."
commands.delegate.summary: "[[ЛИНЕ1]]Припремите задатак и отворите делегираног агента (__ПХ0__ __ПХ1__)"
# {Locked="Enter","Esc","↵","↑","↓","←","→"} - key names and Return-key glyph, do not translate
recommendations.nav_hint: "(↑ ↓ за навигацију • ← → за пребацивање дугмади • Enter за избор • Esc за отказивање)"
recommendations.button_run_command: "[ Покрени команду ]"
recommendations.button_send_to_delegate: "[[ЛИНЕ14]][ Пошаљи делегату ]"
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 722ef254-e7c1-40c7-ab0c-8f667a9de98b
Copilot AI review requested due to automatic review settings August 27, 2026 09:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 120 out of 120 changed files in this pull request and generated no new comments.

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

tools/wta/src/ui/delegate_popup.rs:18

  • popup::anchored_above is currently called with a hard-coded content height (2). This will become incorrect (and visually truncate) if another delegate destination option is ever added or conditionally hidden. Derive the popup height from the item count instead, like the other pickers do.

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.

3 participants