Skip to content

feat(session-text): paste helper that delivers text to any focused pane, including raw terminals #830

Description

@Juliusolsson05

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

  • Rendered panes receive editable unsent drafts.
  • Raw terminals and agent terminal views are valid template targets.
  • Mounted-owner and paste-mode checks prevent unsafe or stale delivery.
  • Deferred-wake cancellation, rejected writes, legacy kind normalization and control-byte refusal have regression coverage.
  • Typecheck and focused unit/renderer tests pass.
  • PR CI and manual terminal/authentication smoke verification.

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions