feat(new-workspace): unified source picker + non-submitted URL drafts for agents#1426
Open
feat(new-workspace): unified source picker + non-submitted URL drafts for agents#1426
Conversation
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
…ertical alignment Co-authored-by: Orca <help@stably.ai>
…e icons, tooltips on pill actions Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
… actually appears in the agent input Co-authored-by: Orca <help@stably.ai>
…i/opencode type-chars) Co-authored-by: Orca <help@stably.ai>
…pi/opencode Replaces per-agent strategy guesswork with a measured readiness check: title-idle / non-shell-foreground stable for 1.5s / 2.5s minimum floor. Verified against codex, pi, opencode, claude in a node-pty + xterm-headless test rig — bracketed paste lands in the input buffer for all four. Co-authored-by: Orca <help@stably.ai>
The TUI-ready heuristic in agent-paste-draft.ts works for every tested agent (claude/codex/pi/opencode), so the AgentDraftInjectionStrategy field, type-chars + bracketed-paste-slow code paths, and per-agent overrides are dead. Keep the `agent` arg on pasteDraftWhenAgentReady for future per-agent escape hatches without touching every call site. Co-authored-by: Orca <help@stably.ai>
Both TUIs open with a 'Do you trust this folder?' menu on first launch that consumes keystrokes as menu input — pasting a URL there either selects an arbitrary option or quits the session. Mark them with skipDraftUrlInjection so the workspace still opens cleanly; the user types/pastes the URL themselves once past the trust menu. Co-authored-by: Orca <help@stably.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two threads landed in this branch:
Unified the New Workspace dialog — replaces the separate "Create from…" tab with a single source-picker (Smart / GitHub / Branch / Linear / Name) inline with the workspace name field. ~1320 lines of `CreateFromTab` removed; the smart field now owns search, mode tabs, cross-repo URL detection, and a dismissible source pill.
Selected-source pill + non-submitted URL drafts — when the user picks a GitHub issue/PR or Linear item, the agent launches with that URL pre-filled in its input as a draft (no auto-submit). Replaces the previous `Complete ` autosubmitted prompt template.
What's in the pill
Agent draft injection
The agent input is pre-filled via bracketed-paste mode (`\x1b[200~…\x1b[201~`) so the URL lands atomically in the TUI's input buffer without a trailing `\r` — the user reviews and sends themselves.
The hard part was timing. Different TUIs need different amounts of warm-up:
Verified empirically with a `node-pty` + `@xterm/headless` test rig that mirrors Orca's spawn flow (DSR/DA1 auto-responses, shell cold-start, then queued startup command).
The new `waitForTuiInputReady` in `src/renderer/src/lib/agent-paste-draft.ts` combines:
One subtlety worth calling out: argv-mode agents distributed via npm (claude, codex, pi) report `process: 'node'` in node-pty even though the binary is the agent. `isAgentForeground` accepts `'node'` for this reason — the previous `expectedProcess: 'codex'` match never fired.
Other tweaks
Known gaps (follow-ups)
Verification
Made with Orca 🐋