Skip to content

Add interactive port mode and richer handoff context - #35

Merged
dbisina merged 1 commit into
mainfrom
feat/interactive-port-context
Aug 12, 2026
Merged

dbisina merged 1 commit into
mainfrom
feat/interactive-port-context

Conversation

@dbisina

@dbisina dbisina commented Aug 12, 2026

Copy link
Copy Markdown
Owner

What

Two changes to the detect -> adopt ("port") flow, plus fixes surfaced by review.

Interactive port (open the provider's own CLI)

Porting a detected session used to only run the target provider headless as a hidden child of the daemon, so nothing visibly happened except events in the dashboard. Adopt can now instead open the provider's own CLI in a terminal — in the adopted project directory, under the chosen account's config dir, seeded with a prompt that reads the full brief — then step back and let the developer drive it.

  • Desktop drawer: the old "Start running it immediately" checkbox is now a mode toggle, Open in (default) vs Run in background (the previous headless path).
  • New relay detect --open flag for the same from the CLI.
  • POST /api/detect/adopt gains an interactive field.

Richer handoff context

The transcript reader already read every turn and kept only the first/last prompt. The brief now also carries a redacted, verbatim tail of the last 16 user/assistant turns, rendered as a "Recent conversation" section, so a port moves real recent context rather than a one-line summary. Every turn passes through the redactor before it can cross the boundary.

Fixes (from an adversarial review of the above)

  • Desktop handOffSession now surfaces daemon body-level adopt errors instead of reporting false success and dismissing the panel.
  • Interactive launch re-applies the persisted active account after a config reload, so it never opens the wrong account's config dir.
  • POSIX env values and command args are shell-quoted (a config dir with a space, e.g. the canonical macOS path, no longer breaks the launch).
  • truncate is rune-safe, so a carried turn is never split mid-character.

Tests

  • New recent_turns_test.go (turn capture, window, rune-safe truncate) and an opt-in launch_smoke_test.go that spawns a real terminal via the production launcher and asserts cwd + env crossed to the child.
  • Full suite: go build, go vet, gofmt, 151 Go tests, npm run typecheck, and electron-vite build all pass.

Scope

Electron desktop (packages/desktop) only; the legacy Rust egui UI is intentionally not mirrored.

Adopting a detected session can now open the target provider's own CLI in
a terminal (in the adopted project, under the chosen account, seeded with
the brief) instead of only running headless. The desktop drawer offers
both as a mode toggle, defaulting to interactive so the developer drives
the session directly. Adds a `relay detect --open` flag for the same.

The handoff brief now carries a redacted, verbatim tail of the last 16
conversation turns rather than only the first and last prompt, so a port
moves real recent context. Every turn passes through the redactor.

Also: rune-safe truncate so a carried turn is never split mid-character;
POSIX env values and args are shell-quoted (paths with spaces no longer
break the launch); the interactive path re-applies the active account
after a config reload; and the desktop surfaces adopt failures instead of
reporting false success.
@dbisina
dbisina merged commit b272286 into main Aug 12, 2026
7 of 8 checks passed
@dbisina
dbisina deleted the feat/interactive-port-context branch August 12, 2026 18:56
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.

1 participant