← Back to Pull requests

feat(cli): worktree, repo, launch-config and forward commands (6/6) #343

Closed
unknown closed this pull request without merging on Nov 06, 2026 02:24 UTC
View on GitHub
unknown unknown commented on Nov 05, 2026 19:51 UTC
Author

Last part of add-agent-shell-control, stacked on #342. It covers tasks §5 (workspace commands) and closes §8. This PR adds no server or contract changes; everything goes through existing endpoints.

Changes

worktree

  • worktree ls [REPO] [--home|--hidden] has a HOME column. Its values follow web/src/homeWorktrees.ts:

  • - pinned: added to the home page;
    - sessions: not added, but shown because it has sessions or archived chat records;
    - hidden.
    - A repository nobody curated shows only its main worktree.
  • worktree show REPO WORKTREE.

  • worktree create REPO --branch NAME [--base REF] | --existing BRANCH [--path] [--refresh-base] [--no-pin].

  • - The default path is <repo>.worktrees/<branch leaf>.
    - The new worktree is added to the home page by default.
  • worktree rm previews the effects on stderr first. Blockers need --force. On a terminal it asks you to type the worktree path; without one it needs --yes.

  • worktree pin|unpin|home [--set|--reset]:

  • - only this repository's homeWorktrees entry changes;
    - on a 409 the CLI reads again and replays its change, at most 3 times;
    - pins of worktrees that no longer exist are pruned.

    repo

  • ls, add (idempotent), rm (unregisters only and clears the home setting), show, refresh, branches.

  • commits --from REF: the CLI resolves branch and base names to full commit IDs.

  • base: a failed fetch is only a warning.

  • repo settings mirrors the repository settings dialog:

  • - --init TEXT|-|@FILE, --clear-init and --edit ($VISUAL/$EDITOR);
    - more than 4000 characters is refused locally with exit 2;
    - unknown quick-command references are a warning, and the instruction is still saved.

    launch-config

  • ls and show. Values show as <hidden> unless --reveal-env.

  • add NAME ... -- ARGV: the command is saved as given, never through a shell. --hybrid checks support first.

  • edit: reads the config, changes only the given fields and saves it whole; values you don't mention are kept.

  • rm, presets, restore.
  • forward

  • ls, add PORT [--label] [--session self] [--no-compat] (prints the address), rm.
  • Other

  • Env.Interactive drives confirmations.

  • Completion now covers launch-config names and forwarded ports.

  • Persistence inventory: one new narrow editor-scratch exception for the --edit temporary file.
  • Docs and user stories

  • New guide topic /llms/workspace.md and a new recipe; the usage page is updated.

  • New stories US-S16, US-S17 and US-S18.

  • US-Q13 updated: the CLI can now switch sides and drive chat.

  • Index, coverage table and verification log updated; tasks §5 and §8 ticked.
  • Verification

  • make check passes, including the persistence guard after registering the exception.

  • make test-fast:

  • - Go race tests pass everywhere except internal/api repository-commits. That failure is only the local git 2.43 date format; it is the same on clean main and green in CI.
    - Frontend unit (658) and browser (547) tests pass.
  • cmd/webmux end-to-end tests with a real server cover worktree, home page states, repo, settings, launch-config CRUD, presets and forwards.

  • internal/sessioncmd unit tests cover the home rules against the web's rules, and the 409 replay and give-up.

  • Not verified: repo settings --edit with a real editor; repo base with a successful fetch; macOS.
  • ---
    _Generated by Claude Code_

    Diff: 435 lines (+326 / -109) across 5 files Reviewer: mzdluo123 Review duration: 393m
    All Vouch review confidence checks passed
    Residual risk 0.27 = Change Risk (0.68) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.68 · 435 lines diff across 5 files
    0.68
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.364
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.068
    Real PR Conversation Timeline
    1 comments
    "Review active on #343"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 68.4% (HIGH) · Higher = larger blast radius
    68.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 27% · Safe to merge
    27%