Motivation
Prompt templates must work in rendered agent panes, agent terminal views, and raw terminal panes running unsupported harnesses. The API Key Vault in #831 uses the same insertion path.
Implemented Contract
- Shared renderer text delivery preserves template append/replace semantics and never submits.
- Terminal insertion routes through the mounted xterm owner, not an unguarded raw write.
- Respect current visibility, attach/replay state, and bracketed-paste mode. Single-line text works without that mode; multiline and unsafe terminal-control input are refused when they cannot be pasted safely.
- Preserve the captured session and picker lifetime through asynchronous preparation and wake. Refused writes keep the picker open without automatic retry into a replacement backend.
- Plain key insertion appends without template paragraph spacing.
Acceptance Criteria
Verification
Related branch: feat/api-key-vault. Claude and Codex review fixes are included. Latest focused set: 89 passing tests across 12 files. Desktop/remote build passes. A low-concurrency full-suite run exceeded ten minutes with unrelated lazy-Markdown and fixture failures; this is not recorded as a green full-suite gate.
Motivation
Prompt templates must work in rendered agent panes, agent terminal views, and raw terminal panes running unsupported harnesses. The API Key Vault in #831 uses the same insertion path.
Implemented Contract
Acceptance Criteria
Verification
Related branch: feat/api-key-vault. Claude and Codex review fixes are included. Latest focused set: 89 passing tests across 12 files. Desktop/remote build passes. A low-concurrency full-suite run exceeded ten minutes with unrelated lazy-Markdown and fixture failures; this is not recorded as a green full-suite gate.