cli: warm fast path spawns the harness in ~20ms; 10x faster cold launches - #258

Merged
willwashburn merged 5 commits into
mainfrom
perf/launch-fast
Jul 13, 2026
Merged

cli: warm fast path spawns the harness in ~20ms; 10x faster cold launches#258
willwashburn merged 5 commits into
mainfrom
perf/launch-fast

Conversation

@willwashburn

@willwashburnwillwashburn commented Jul 13, 2026

Copy link
Copy Markdown
Member

What this is

agentworkforce agent <persona> spawns the harness in ~20ms on repeat launches and ~2.5s cold (relay repo; previously ~26s), with session teardown under 1s (previously ~11s).

Warm fast path

A successful mount session keeps its sandbox mount under ~/.agentworkforce/workforce/cache/warm-mounts/ together with a launch plan: the resolved spawn (absolute bin + argv + default-derived env), stat digests of every input that fed resolution (persona file, persona source dirs + config, .agentignore/.agentreadonly, local skill sources), pinned env vars, and the skill-cache fingerprint.

The next launch of the same selector runs a dependency-free entry (fast-launch.ts, node builtins only): validate the plan, claim the warm mount by atomic rename, spawn the harness. The heavy CLI module loads after the child is running, reattaches the mount with the previous session's exported autosync state, reconciles against the repo while the harness TUI boots (~600ms, well inside harness startup), re-verifies the plan against live resolution, and runs the normal metadata/drain/sync-back/re-warm flow on exit.

Plans hold no secrets by construction: eligibility refuses personas with env maps, mcpServers, ai-memory wiring, env-provided inputs, or (outside opencode, which ignores it) relay MCP config. Everything else — any flag, any digest mismatch, a set pinned env var, a due upstream-drift check, a lost rename race — falls back silently to the full launch, which rebuilds both plan and warm mount. AGENTWORKFORCE_NO_FAST=1 disables; AGENTWORKFORCE_PERF=1 prints launch-phase timings.

Cold path

  • Mounts populate via @relayfile/local-mountpopulation: 'auto' (git ls-files): 1,477 files instead of 38,561 in relay, and autosync starts from population-seeded state instead of byte-comparing every file pair (was 9.3s).
  • The skill-cache mirror no longer copies the install-time .npm-cache (41MB) into the mount.
  • Cloud subcommand handlers (deploy/invoke/runs/destroy/integrations/deployments) load lazily at dispatch — they pulled @agent-relay/cloud onto every launch (~180ms).
  • cli.ts is now a thin entry; the implementation lives in cli-impl.ts.

Verified end-to-end (relay repo, harness stubbed)

  • Warm spawn at +20.5ms; host-side edits made between sessions visible in the mount before the agent reads (reconcile completes ~600ms); agent writes sync back to the repo; deletions made between sessions propagate into the warm mount instead of resurrecting; editing the persona file forces the full path and the following launch is warm again.

Merge order

Requires @relayfile/local-mount0.11.0 (AgentWorkforce/relayfile#349): population, attachMount, exportState, and the external-teardown safety guard. Release relayfile first, then land this; install/CI here stays red until that version is on npm.

🤖 Generated with Claude Code

Review in cubic

…d launches
agent <persona> launches now keep the session's sandbox mount warm and
record a digest-validated launch plan. The next launch of the same
selector validates the plan with a handful of stats (~20ms including
node boot), claims the warm mount by atomic rename, and spawns the
harness immediately; the heavy CLI module loads afterward, reattaches
the mount with the previous session's autosync state, and reconciles
while the harness boots. Any change to the persona, source dirs,
skills, dotfiles, or pinned env falls back to the full path
(AGENTWORKFORCE_NO_FAST=1 disables).
Cold launches populate mounts from git ls-files (local-mount
population: 'auto'), start autosync from population-seeded state, skip
the npm cache when mirroring skills, and lazy-load cloud subcommand
handlers. In the relay repo: 26s -> 2.5s cold, ~20ms warm; teardown
11s -> <1s.
Requires @relayfile/local-mount ^0.11.0 (release upstream first).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitaiBot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

💤 Files selected but had no reviewable changes (1)
  • packages/cli/src/cli-impl.ts
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 19d480c9-5f7f-4e0f-a9b3-331472fdf397

📥 Commits

Reviewing files that changed from the base of the PR and between 3401fb2 and 6c6dc7e.

📒 Files selected for processing (1)
  • packages/cli/src/cli-impl.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The CLI implementation moves into cli-impl.ts, adds validated warm-session reuse through persisted launch plans, expands persona session and improvement workflows, updates the entrypoint delegation, and upgrades the local-mount dependency.

Changes

CLI runtime and warm launch

Layer / File(s)Summary
Warm launch plan and validation
packages/cli/src/fast-launch.ts, packages/cli/src/fast-launch.test.ts
Persisted launch plans validate CLI state, environment pins, filesystem digests, skill-cache markers, and warm-mount markers before spawning a resumed harness session.
Persona selection and interactive sessions
packages/cli/src/cli-impl.ts
Persona resolution, skill installation and caching, sandbox configuration, dry-run validation, interactive harness launching, autosync, and warm-plan preparation are implemented.
Resume, commands, and persona improvement
packages/cli/src/cli-impl.ts
Warm sessions can resume and drain safely; persona commands, transcript discovery, improver proposal validation, interactive acceptance, and guarded patch application are added.
Entrypoint delegation and package updates
packages/cli/src/cli.ts, packages/cli/src/cli.test.ts, packages/cli/package.json, packages/persona-kit/package.json, CHANGELOG.md
The entrypoint attempts the warm path before loading the full implementation, tests target the relocated module, and mount dependency and changelog entries are updated.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
participant User
participant CLI as cli.ts
participant Runtime as cli-impl.ts
participant Mount as sandbox mount
participant Harness
User->>CLI: agent selector
CLI->>Runtime: delegate normal launch
Runtime->>Mount: configure and populate mount
Runtime->>Harness: spawn interactive session
Harness-->>Runtime: session exit
Runtime->>Mount: autosync and prepare warm plan
Loading

Poem

I’m a bunny with a launch plan bright,
Reusing warm mounts through the night.
Skills hop in, sidecars align,
Digests guard each cached design.
Faster paws and cleaner flow—
Off to the next persona we go!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 23.53% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Title check✅ PassedThe title accurately summarizes the warm fast path and cold-launch speedups in the CLI.
Description check✅ PassedThe description is directly about the CLI fast path, cold-launch optimizations, and dependency update.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/launch-fast

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…module load
The harness child spawns before cli-impl loads; a child that exits
during that import has already emitted 'close', so the resume must read
the settled exitCode/signalCode instead of waiting forever for an event
that fired with no listener.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@gemini-code-assistgemini-code-assistBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a warm-launch fast path for @agentworkforce/cli that allows repeat launches of the same persona to reuse the previous session's sandbox mount and a digest-validated launch plan, significantly reducing startup times. The changes include the addition of fast-launch.ts and its corresponding tests, as well as updating the @relayfile/local-mount dependency. Feedback on these changes suggests wrapping the validation phase of tryFastAgentLaunch in a try-catch block to prevent potential crashes from corrupted or manually edited launch plans. Additionally, it is recommended to normalize directory sizes to zero in statDigestOf to avoid filesystem-dependent mismatch noise and to document the limitations of using directory stats for change detection.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment threadpackages/cli/src/fast-launch.ts
Comment threadpackages/cli/src/fast-launch.ts

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:39ae62851b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment threadpackages/cli/src/cli.ts
Comment threadpackages/cli/src/cli-impl.ts
Comment threadpackages/cli/src/cli-impl.ts

@cubic-dev-aicubic-dev-aiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed

Not reviewed (too large): packages/cli/src/cli.ts (~4,751 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

Comment threadpackages/cli/src/fast-launch.ts
Comment threadpackages/cli/src/fast-launch.ts Outdated
Comment threadpackages/cli/package.json Outdated
Comment threadpackages/cli/src/fast-launch.ts
willwashburnand others added 2 commits July 12, 2026 22:26
- Corrupted/truncated launch plans fall back to the full launch instead
of throwing (blanket guard in tryFastAgentLaunch)
- Digest every persona JSON in every source layer, not just the winning
file: same-id layers merge, and in-place edits don't touch dir mtimes.
Directory digests pin size to 0 (filesystem-dependent noise)
- Path-form sidecars (claudeMd/agentsMd file refs) make a launch
ineligible for plan caching until those files join the digest set
- Park async child spawn errors in fast-launch so an early 'error' can't
crash during the heavy import and the session manager resolves 127
- A failed drain/sync-back after a clean harness exit returns exit code
1 instead of masquerading as success (matches the cold path)
- persona-kit: bump @relayfile/local-mount to ^0.11.0 so pnpm hoists a
single copy alongside the CLI's
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The relayfile release train shipped the fast-launch changes as 0.10.23
(lockstep patch), not the 0.11.0 this branch anticipated. Ranges in cli
and persona-kit now track ^0.10.23 and the lockfile resolves the
published package. Cold/warm E2E re-verified against the npm tarball:
2.8s cold, ~20ms warm to harness spawn in relay.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cli/src/cli-impl.ts`:
- Around line 1617-1629: Update resolveBinOnPath to split process.env.PATH using
the platform-specific path.delimiter instead of a hardcoded colon. Ensure
Windows resolution also considers executable extensions such as .cmd and .exe
when checking candidates, while preserving existing absolute-path and Unix
behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b5c5f8af-f917-4cb3-ac04-7cfd87a6104d

📥 Commits

Reviewing files that changed from the base of the PR and between 57ab062 and 3401fb2.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • CHANGELOG.md
  • packages/cli/package.json
  • packages/cli/src/cli-impl.ts
  • packages/cli/src/cli.test.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/fast-launch.test.ts
  • packages/cli/src/fast-launch.ts
  • packages/persona-kit/package.json

Comment threadpackages/cli/src/cli-impl.ts
Windows PATHEXT shims stay unresolved by design — the warm fast path
simply never engages there and launches take the full path.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@willwashburn
willwashburn merged commit c529294 into mainJul 13, 2026
3 checks passed
@willwashburn
willwashburn deleted the perf/launch-fast branch July 13, 2026 14:23
Sign up for freeto 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

@willwashburn
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

cli: warm fast path spawns the harness in ~20ms; 10x faster cold launches - #258

Merged
willwashburn merged 5 commits into
mainfrom
perf/launch-fast
Jul 13, 2026
Merged

cli: warm fast path spawns the harness in ~20ms; 10x faster cold launches#258
willwashburn merged 5 commits into
mainfrom
perf/launch-fast

Conversation

@willwashburn

@willwashburnwillwashburn commented Jul 13, 2026

Copy link
Copy Markdown
Member

What this is

agentworkforce agent <persona> spawns the harness in ~20ms on repeat launches and ~2.5s cold (relay repo; previously ~26s), with session teardown under 1s (previously ~11s).

Warm fast path

A successful mount session keeps its sandbox mount under ~/.agentworkforce/workforce/cache/warm-mounts/ together with a launch plan: the resolved spawn (absolute bin + argv + default-derived env), stat digests of every input that fed resolution (persona file, persona source dirs + config, .agentignore/.agentreadonly, local skill sources), pinned env vars, and the skill-cache fingerprint.

The next launch of the same selector runs a dependency-free entry (fast-launch.ts, node builtins only): validate the plan, claim the warm mount by atomic rename, spawn the harness. The heavy CLI module loads after the child is running, reattaches the mount with the previous session's exported autosync state, reconciles against the repo while the harness TUI boots (~600ms, well inside harness startup), re-verifies the plan against live resolution, and runs the normal metadata/drain/sync-back/re-warm flow on exit.

Plans hold no secrets by construction: eligibility refuses personas with env maps, mcpServers, ai-memory wiring, env-provided inputs, or (outside opencode, which ignores it) relay MCP config. Everything else — any flag, any digest mismatch, a set pinned env var, a due upstream-drift check, a lost rename race — falls back silently to the full launch, which rebuilds both plan and warm mount. AGENTWORKFORCE_NO_FAST=1 disables; AGENTWORKFORCE_PERF=1 prints launch-phase timings.

Cold path

  • Mounts populate via @relayfile/local-mountpopulation: 'auto' (git ls-files): 1,477 files instead of 38,561 in relay, and autosync starts from population-seeded state instead of byte-comparing every file pair (was 9.3s).
  • The skill-cache mirror no longer copies the install-time .npm-cache (41MB) into the mount.
  • Cloud subcommand handlers (deploy/invoke/runs/destroy/integrations/deployments) load lazily at dispatch — they pulled @agent-relay/cloud onto every launch (~180ms).
  • cli.ts is now a thin entry; the implementation lives in cli-impl.ts.

Verified end-to-end (relay repo, harness stubbed)

  • Warm spawn at +20.5ms; host-side edits made between sessions visible in the mount before the agent reads (reconcile completes ~600ms); agent writes sync back to the repo; deletions made between sessions propagate into the warm mount instead of resurrecting; editing the persona file forces the full path and the following launch is warm again.

Merge order

Requires @relayfile/local-mount0.11.0 (AgentWorkforce/relayfile#349): population, attachMount, exportState, and the external-teardown safety guard. Release relayfile first, then land this; install/CI here stays red until that version is on npm.

🤖 Generated with Claude Code

Review in cubic

…d launches
agent <persona> launches now keep the session's sandbox mount warm and
record a digest-validated launch plan. The next launch of the same
selector validates the plan with a handful of stats (~20ms including
node boot), claims the warm mount by atomic rename, and spawns the
harness immediately; the heavy CLI module loads afterward, reattaches
the mount with the previous session's autosync state, and reconciles
while the harness boots. Any change to the persona, source dirs,
skills, dotfiles, or pinned env falls back to the full path
(AGENTWORKFORCE_NO_FAST=1 disables).
Cold launches populate mounts from git ls-files (local-mount
population: 'auto'), start autosync from population-seeded state, skip
the npm cache when mirroring skills, and lazy-load cloud subcommand
handlers. In the relay repo: 26s -> 2.5s cold, ~20ms warm; teardown
11s -> <1s.
Requires @relayfile/local-mount ^0.11.0 (release upstream first).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitaiBot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

💤 Files selected but had no reviewable changes (1)
  • packages/cli/src/cli-impl.ts
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 19d480c9-5f7f-4e0f-a9b3-331472fdf397

📥 Commits

Reviewing files that changed from the base of the PR and between 3401fb2 and 6c6dc7e.

📒 Files selected for processing (1)
  • packages/cli/src/cli-impl.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The CLI implementation moves into cli-impl.ts, adds validated warm-session reuse through persisted launch plans, expands persona session and improvement workflows, updates the entrypoint delegation, and upgrades the local-mount dependency.

Changes

CLI runtime and warm launch

Layer / File(s)Summary
Warm launch plan and validation
packages/cli/src/fast-launch.ts, packages/cli/src/fast-launch.test.ts
Persisted launch plans validate CLI state, environment pins, filesystem digests, skill-cache markers, and warm-mount markers before spawning a resumed harness session.
Persona selection and interactive sessions
packages/cli/src/cli-impl.ts
Persona resolution, skill installation and caching, sandbox configuration, dry-run validation, interactive harness launching, autosync, and warm-plan preparation are implemented.
Resume, commands, and persona improvement
packages/cli/src/cli-impl.ts
Warm sessions can resume and drain safely; persona commands, transcript discovery, improver proposal validation, interactive acceptance, and guarded patch application are added.
Entrypoint delegation and package updates
packages/cli/src/cli.ts, packages/cli/src/cli.test.ts, packages/cli/package.json, packages/persona-kit/package.json, CHANGELOG.md
The entrypoint attempts the warm path before loading the full implementation, tests target the relocated module, and mount dependency and changelog entries are updated.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
participant User
participant CLI as cli.ts
participant Runtime as cli-impl.ts
participant Mount as sandbox mount
participant Harness
User->>CLI: agent selector
CLI->>Runtime: delegate normal launch
Runtime->>Mount: configure and populate mount
Runtime->>Harness: spawn interactive session
Harness-->>Runtime: session exit
Runtime->>Mount: autosync and prepare warm plan
Loading

Poem

I’m a bunny with a launch plan bright,
Reusing warm mounts through the night.
Skills hop in, sidecars align,
Digests guard each cached design.
Faster paws and cleaner flow—
Off to the next persona we go!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 23.53% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Title check✅ PassedThe title accurately summarizes the warm fast path and cold-launch speedups in the CLI.
Description check✅ PassedThe description is directly about the CLI fast path, cold-launch optimizations, and dependency update.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/launch-fast

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…module load
The harness child spawns before cli-impl loads; a child that exits
during that import has already emitted 'close', so the resume must read
the settled exitCode/signalCode instead of waiting forever for an event
that fired with no listener.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@gemini-code-assistgemini-code-assistBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a warm-launch fast path for @agentworkforce/cli that allows repeat launches of the same persona to reuse the previous session's sandbox mount and a digest-validated launch plan, significantly reducing startup times. The changes include the addition of fast-launch.ts and its corresponding tests, as well as updating the @relayfile/local-mount dependency. Feedback on these changes suggests wrapping the validation phase of tryFastAgentLaunch in a try-catch block to prevent potential crashes from corrupted or manually edited launch plans. Additionally, it is recommended to normalize directory sizes to zero in statDigestOf to avoid filesystem-dependent mismatch noise and to document the limitations of using directory stats for change detection.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment threadpackages/cli/src/fast-launch.ts
Comment threadpackages/cli/src/fast-launch.ts

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:39ae62851b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment threadpackages/cli/src/cli.ts
Comment threadpackages/cli/src/cli-impl.ts
Comment threadpackages/cli/src/cli-impl.ts

@cubic-dev-aicubic-dev-aiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed

Not reviewed (too large): packages/cli/src/cli.ts (~4,751 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

Comment threadpackages/cli/src/fast-launch.ts
Comment threadpackages/cli/src/fast-launch.ts Outdated
Comment threadpackages/cli/package.json Outdated
Comment threadpackages/cli/src/fast-launch.ts
willwashburnand others added 2 commits July 12, 2026 22:26
- Corrupted/truncated launch plans fall back to the full launch instead
of throwing (blanket guard in tryFastAgentLaunch)
- Digest every persona JSON in every source layer, not just the winning
file: same-id layers merge, and in-place edits don't touch dir mtimes.
Directory digests pin size to 0 (filesystem-dependent noise)
- Path-form sidecars (claudeMd/agentsMd file refs) make a launch
ineligible for plan caching until those files join the digest set
- Park async child spawn errors in fast-launch so an early 'error' can't
crash during the heavy import and the session manager resolves 127
- A failed drain/sync-back after a clean harness exit returns exit code
1 instead of masquerading as success (matches the cold path)
- persona-kit: bump @relayfile/local-mount to ^0.11.0 so pnpm hoists a
single copy alongside the CLI's
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The relayfile release train shipped the fast-launch changes as 0.10.23
(lockstep patch), not the 0.11.0 this branch anticipated. Ranges in cli
and persona-kit now track ^0.10.23 and the lockfile resolves the
published package. Cold/warm E2E re-verified against the npm tarball:
2.8s cold, ~20ms warm to harness spawn in relay.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cli/src/cli-impl.ts`:
- Around line 1617-1629: Update resolveBinOnPath to split process.env.PATH using
the platform-specific path.delimiter instead of a hardcoded colon. Ensure
Windows resolution also considers executable extensions such as .cmd and .exe
when checking candidates, while preserving existing absolute-path and Unix
behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b5c5f8af-f917-4cb3-ac04-7cfd87a6104d

📥 Commits

Reviewing files that changed from the base of the PR and between 57ab062 and 3401fb2.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • CHANGELOG.md
  • packages/cli/package.json
  • packages/cli/src/cli-impl.ts
  • packages/cli/src/cli.test.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/fast-launch.test.ts
  • packages/cli/src/fast-launch.ts
  • packages/persona-kit/package.json

Comment threadpackages/cli/src/cli-impl.ts
Windows PATHEXT shims stay unresolved by design — the warm fast path
simply never engages there and launches take the full path.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@willwashburn
willwashburn merged commit c529294 into mainJul 13, 2026
3 checks passed
@willwashburn
willwashburn deleted the perf/launch-fast branch July 13, 2026 14:23
Sign up for freeto 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

@willwashburn
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

cli: warm fast path spawns the harness in ~20ms; 10x faster cold launches - #258

Merged
willwashburn merged 5 commits into
mainfrom
perf/launch-fast
Jul 13, 2026
Merged

cli: warm fast path spawns the harness in ~20ms; 10x faster cold launches#258
willwashburn merged 5 commits into
mainfrom
perf/launch-fast

Conversation

@willwashburn

@willwashburnwillwashburn commented Jul 13, 2026

Copy link
Copy Markdown
Member

What this is

agentworkforce agent <persona> spawns the harness in ~20ms on repeat launches and ~2.5s cold (relay repo; previously ~26s), with session teardown under 1s (previously ~11s).

Warm fast path

A successful mount session keeps its sandbox mount under ~/.agentworkforce/workforce/cache/warm-mounts/ together with a launch plan: the resolved spawn (absolute bin + argv + default-derived env), stat digests of every input that fed resolution (persona file, persona source dirs + config, .agentignore/.agentreadonly, local skill sources), pinned env vars, and the skill-cache fingerprint.

The next launch of the same selector runs a dependency-free entry (fast-launch.ts, node builtins only): validate the plan, claim the warm mount by atomic rename, spawn the harness. The heavy CLI module loads after the child is running, reattaches the mount with the previous session's exported autosync state, reconciles against the repo while the harness TUI boots (~600ms, well inside harness startup), re-verifies the plan against live resolution, and runs the normal metadata/drain/sync-back/re-warm flow on exit.

Plans hold no secrets by construction: eligibility refuses personas with env maps, mcpServers, ai-memory wiring, env-provided inputs, or (outside opencode, which ignores it) relay MCP config. Everything else — any flag, any digest mismatch, a set pinned env var, a due upstream-drift check, a lost rename race — falls back silently to the full launch, which rebuilds both plan and warm mount. AGENTWORKFORCE_NO_FAST=1 disables; AGENTWORKFORCE_PERF=1 prints launch-phase timings.

Cold path

  • Mounts populate via @relayfile/local-mountpopulation: 'auto' (git ls-files): 1,477 files instead of 38,561 in relay, and autosync starts from population-seeded state instead of byte-comparing every file pair (was 9.3s).
  • The skill-cache mirror no longer copies the install-time .npm-cache (41MB) into the mount.
  • Cloud subcommand handlers (deploy/invoke/runs/destroy/integrations/deployments) load lazily at dispatch — they pulled @agent-relay/cloud onto every launch (~180ms).
  • cli.ts is now a thin entry; the implementation lives in cli-impl.ts.

Verified end-to-end (relay repo, harness stubbed)

  • Warm spawn at +20.5ms; host-side edits made between sessions visible in the mount before the agent reads (reconcile completes ~600ms); agent writes sync back to the repo; deletions made between sessions propagate into the warm mount instead of resurrecting; editing the persona file forces the full path and the following launch is warm again.

Merge order

Requires @relayfile/local-mount0.11.0 (AgentWorkforce/relayfile#349): population, attachMount, exportState, and the external-teardown safety guard. Release relayfile first, then land this; install/CI here stays red until that version is on npm.

🤖 Generated with Claude Code

Review in cubic

…d launches
agent <persona> launches now keep the session's sandbox mount warm and
record a digest-validated launch plan. The next launch of the same
selector validates the plan with a handful of stats (~20ms including
node boot), claims the warm mount by atomic rename, and spawns the
harness immediately; the heavy CLI module loads afterward, reattaches
the mount with the previous session's autosync state, and reconciles
while the harness boots. Any change to the persona, source dirs,
skills, dotfiles, or pinned env falls back to the full path
(AGENTWORKFORCE_NO_FAST=1 disables).
Cold launches populate mounts from git ls-files (local-mount
population: 'auto'), start autosync from population-seeded state, skip
the npm cache when mirroring skills, and lazy-load cloud subcommand
handlers. In the relay repo: 26s -> 2.5s cold, ~20ms warm; teardown
11s -> <1s.
Requires @relayfile/local-mount ^0.11.0 (release upstream first).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitaiBot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

💤 Files selected but had no reviewable changes (1)
  • packages/cli/src/cli-impl.ts
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 19d480c9-5f7f-4e0f-a9b3-331472fdf397

📥 Commits

Reviewing files that changed from the base of the PR and between 3401fb2 and 6c6dc7e.

📒 Files selected for processing (1)
  • packages/cli/src/cli-impl.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The CLI implementation moves into cli-impl.ts, adds validated warm-session reuse through persisted launch plans, expands persona session and improvement workflows, updates the entrypoint delegation, and upgrades the local-mount dependency.

Changes

CLI runtime and warm launch

Layer / File(s)Summary
Warm launch plan and validation
packages/cli/src/fast-launch.ts, packages/cli/src/fast-launch.test.ts
Persisted launch plans validate CLI state, environment pins, filesystem digests, skill-cache markers, and warm-mount markers before spawning a resumed harness session.
Persona selection and interactive sessions
packages/cli/src/cli-impl.ts
Persona resolution, skill installation and caching, sandbox configuration, dry-run validation, interactive harness launching, autosync, and warm-plan preparation are implemented.
Resume, commands, and persona improvement
packages/cli/src/cli-impl.ts
Warm sessions can resume and drain safely; persona commands, transcript discovery, improver proposal validation, interactive acceptance, and guarded patch application are added.
Entrypoint delegation and package updates
packages/cli/src/cli.ts, packages/cli/src/cli.test.ts, packages/cli/package.json, packages/persona-kit/package.json, CHANGELOG.md
The entrypoint attempts the warm path before loading the full implementation, tests target the relocated module, and mount dependency and changelog entries are updated.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
participant User
participant CLI as cli.ts
participant Runtime as cli-impl.ts
participant Mount as sandbox mount
participant Harness
User->>CLI: agent selector
CLI->>Runtime: delegate normal launch
Runtime->>Mount: configure and populate mount
Runtime->>Harness: spawn interactive session
Harness-->>Runtime: session exit
Runtime->>Mount: autosync and prepare warm plan
Loading

Poem

I’m a bunny with a launch plan bright,
Reusing warm mounts through the night.
Skills hop in, sidecars align,
Digests guard each cached design.
Faster paws and cleaner flow—
Off to the next persona we go!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 23.53% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Title check✅ PassedThe title accurately summarizes the warm fast path and cold-launch speedups in the CLI.
Description check✅ PassedThe description is directly about the CLI fast path, cold-launch optimizations, and dependency update.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/launch-fast

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…module load
The harness child spawns before cli-impl loads; a child that exits
during that import has already emitted 'close', so the resume must read
the settled exitCode/signalCode instead of waiting forever for an event
that fired with no listener.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@gemini-code-assistgemini-code-assistBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a warm-launch fast path for @agentworkforce/cli that allows repeat launches of the same persona to reuse the previous session's sandbox mount and a digest-validated launch plan, significantly reducing startup times. The changes include the addition of fast-launch.ts and its corresponding tests, as well as updating the @relayfile/local-mount dependency. Feedback on these changes suggests wrapping the validation phase of tryFastAgentLaunch in a try-catch block to prevent potential crashes from corrupted or manually edited launch plans. Additionally, it is recommended to normalize directory sizes to zero in statDigestOf to avoid filesystem-dependent mismatch noise and to document the limitations of using directory stats for change detection.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment threadpackages/cli/src/fast-launch.ts
Comment threadpackages/cli/src/fast-launch.ts

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:39ae62851b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment threadpackages/cli/src/cli.ts
Comment threadpackages/cli/src/cli-impl.ts
Comment threadpackages/cli/src/cli-impl.ts

@cubic-dev-aicubic-dev-aiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed

Not reviewed (too large): packages/cli/src/cli.ts (~4,751 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

Comment threadpackages/cli/src/fast-launch.ts
Comment threadpackages/cli/src/fast-launch.ts Outdated
Comment threadpackages/cli/package.json Outdated
Comment threadpackages/cli/src/fast-launch.ts
willwashburnand others added 2 commits July 12, 2026 22:26
- Corrupted/truncated launch plans fall back to the full launch instead
of throwing (blanket guard in tryFastAgentLaunch)
- Digest every persona JSON in every source layer, not just the winning
file: same-id layers merge, and in-place edits don't touch dir mtimes.
Directory digests pin size to 0 (filesystem-dependent noise)
- Path-form sidecars (claudeMd/agentsMd file refs) make a launch
ineligible for plan caching until those files join the digest set
- Park async child spawn errors in fast-launch so an early 'error' can't
crash during the heavy import and the session manager resolves 127
- A failed drain/sync-back after a clean harness exit returns exit code
1 instead of masquerading as success (matches the cold path)
- persona-kit: bump @relayfile/local-mount to ^0.11.0 so pnpm hoists a
single copy alongside the CLI's
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The relayfile release train shipped the fast-launch changes as 0.10.23
(lockstep patch), not the 0.11.0 this branch anticipated. Ranges in cli
and persona-kit now track ^0.10.23 and the lockfile resolves the
published package. Cold/warm E2E re-verified against the npm tarball:
2.8s cold, ~20ms warm to harness spawn in relay.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cli/src/cli-impl.ts`:
- Around line 1617-1629: Update resolveBinOnPath to split process.env.PATH using
the platform-specific path.delimiter instead of a hardcoded colon. Ensure
Windows resolution also considers executable extensions such as .cmd and .exe
when checking candidates, while preserving existing absolute-path and Unix
behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b5c5f8af-f917-4cb3-ac04-7cfd87a6104d

📥 Commits

Reviewing files that changed from the base of the PR and between 57ab062 and 3401fb2.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • CHANGELOG.md
  • packages/cli/package.json
  • packages/cli/src/cli-impl.ts
  • packages/cli/src/cli.test.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/fast-launch.test.ts
  • packages/cli/src/fast-launch.ts
  • packages/persona-kit/package.json

Comment threadpackages/cli/src/cli-impl.ts
Windows PATHEXT shims stay unresolved by design — the warm fast path
simply never engages there and launches take the full path.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@willwashburn
willwashburn merged commit c529294 into mainJul 13, 2026
3 checks passed
@willwashburn
willwashburn deleted the perf/launch-fast branch July 13, 2026 14:23
Sign up for freeto 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

@willwashburn
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

cli: warm fast path spawns the harness in ~20ms; 10x faster cold launches - #258

Merged
willwashburn merged 5 commits into
mainfrom
perf/launch-fast
Jul 13, 2026
Merged

cli: warm fast path spawns the harness in ~20ms; 10x faster cold launches#258
willwashburn merged 5 commits into
mainfrom
perf/launch-fast

Conversation

@willwashburn

@willwashburnwillwashburn commented Jul 13, 2026

Copy link
Copy Markdown
Member

What this is

agentworkforce agent <persona> spawns the harness in ~20ms on repeat launches and ~2.5s cold (relay repo; previously ~26s), with session teardown under 1s (previously ~11s).

Warm fast path

A successful mount session keeps its sandbox mount under ~/.agentworkforce/workforce/cache/warm-mounts/ together with a launch plan: the resolved spawn (absolute bin + argv + default-derived env), stat digests of every input that fed resolution (persona file, persona source dirs + config, .agentignore/.agentreadonly, local skill sources), pinned env vars, and the skill-cache fingerprint.

The next launch of the same selector runs a dependency-free entry (fast-launch.ts, node builtins only): validate the plan, claim the warm mount by atomic rename, spawn the harness. The heavy CLI module loads after the child is running, reattaches the mount with the previous session's exported autosync state, reconciles against the repo while the harness TUI boots (~600ms, well inside harness startup), re-verifies the plan against live resolution, and runs the normal metadata/drain/sync-back/re-warm flow on exit.

Plans hold no secrets by construction: eligibility refuses personas with env maps, mcpServers, ai-memory wiring, env-provided inputs, or (outside opencode, which ignores it) relay MCP config. Everything else — any flag, any digest mismatch, a set pinned env var, a due upstream-drift check, a lost rename race — falls back silently to the full launch, which rebuilds both plan and warm mount. AGENTWORKFORCE_NO_FAST=1 disables; AGENTWORKFORCE_PERF=1 prints launch-phase timings.

Cold path

  • Mounts populate via @relayfile/local-mountpopulation: 'auto' (git ls-files): 1,477 files instead of 38,561 in relay, and autosync starts from population-seeded state instead of byte-comparing every file pair (was 9.3s).
  • The skill-cache mirror no longer copies the install-time .npm-cache (41MB) into the mount.
  • Cloud subcommand handlers (deploy/invoke/runs/destroy/integrations/deployments) load lazily at dispatch — they pulled @agent-relay/cloud onto every launch (~180ms).
  • cli.ts is now a thin entry; the implementation lives in cli-impl.ts.

Verified end-to-end (relay repo, harness stubbed)

  • Warm spawn at +20.5ms; host-side edits made between sessions visible in the mount before the agent reads (reconcile completes ~600ms); agent writes sync back to the repo; deletions made between sessions propagate into the warm mount instead of resurrecting; editing the persona file forces the full path and the following launch is warm again.

Merge order

Requires @relayfile/local-mount0.11.0 (AgentWorkforce/relayfile#349): population, attachMount, exportState, and the external-teardown safety guard. Release relayfile first, then land this; install/CI here stays red until that version is on npm.

🤖 Generated with Claude Code

Review in cubic

…d launches
agent <persona> launches now keep the session's sandbox mount warm and
record a digest-validated launch plan. The next launch of the same
selector validates the plan with a handful of stats (~20ms including
node boot), claims the warm mount by atomic rename, and spawns the
harness immediately; the heavy CLI module loads afterward, reattaches
the mount with the previous session's autosync state, and reconciles
while the harness boots. Any change to the persona, source dirs,
skills, dotfiles, or pinned env falls back to the full path
(AGENTWORKFORCE_NO_FAST=1 disables).
Cold launches populate mounts from git ls-files (local-mount
population: 'auto'), start autosync from population-seeded state, skip
the npm cache when mirroring skills, and lazy-load cloud subcommand
handlers. In the relay repo: 26s -> 2.5s cold, ~20ms warm; teardown
11s -> <1s.
Requires @relayfile/local-mount ^0.11.0 (release upstream first).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitaiBot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

💤 Files selected but had no reviewable changes (1)
  • packages/cli/src/cli-impl.ts
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 19d480c9-5f7f-4e0f-a9b3-331472fdf397

📥 Commits

Reviewing files that changed from the base of the PR and between 3401fb2 and 6c6dc7e.

📒 Files selected for processing (1)
  • packages/cli/src/cli-impl.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The CLI implementation moves into cli-impl.ts, adds validated warm-session reuse through persisted launch plans, expands persona session and improvement workflows, updates the entrypoint delegation, and upgrades the local-mount dependency.

Changes

CLI runtime and warm launch

Layer / File(s)Summary
Warm launch plan and validation
packages/cli/src/fast-launch.ts, packages/cli/src/fast-launch.test.ts
Persisted launch plans validate CLI state, environment pins, filesystem digests, skill-cache markers, and warm-mount markers before spawning a resumed harness session.
Persona selection and interactive sessions
packages/cli/src/cli-impl.ts
Persona resolution, skill installation and caching, sandbox configuration, dry-run validation, interactive harness launching, autosync, and warm-plan preparation are implemented.
Resume, commands, and persona improvement
packages/cli/src/cli-impl.ts
Warm sessions can resume and drain safely; persona commands, transcript discovery, improver proposal validation, interactive acceptance, and guarded patch application are added.
Entrypoint delegation and package updates
packages/cli/src/cli.ts, packages/cli/src/cli.test.ts, packages/cli/package.json, packages/persona-kit/package.json, CHANGELOG.md
The entrypoint attempts the warm path before loading the full implementation, tests target the relocated module, and mount dependency and changelog entries are updated.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
participant User
participant CLI as cli.ts
participant Runtime as cli-impl.ts
participant Mount as sandbox mount
participant Harness
User->>CLI: agent selector
CLI->>Runtime: delegate normal launch
Runtime->>Mount: configure and populate mount
Runtime->>Harness: spawn interactive session
Harness-->>Runtime: session exit
Runtime->>Mount: autosync and prepare warm plan
Loading

Poem

I’m a bunny with a launch plan bright,
Reusing warm mounts through the night.
Skills hop in, sidecars align,
Digests guard each cached design.
Faster paws and cleaner flow—
Off to the next persona we go!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 23.53% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Title check✅ PassedThe title accurately summarizes the warm fast path and cold-launch speedups in the CLI.
Description check✅ PassedThe description is directly about the CLI fast path, cold-launch optimizations, and dependency update.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/launch-fast

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…module load
The harness child spawns before cli-impl loads; a child that exits
during that import has already emitted 'close', so the resume must read
the settled exitCode/signalCode instead of waiting forever for an event
that fired with no listener.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@gemini-code-assistgemini-code-assistBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a warm-launch fast path for @agentworkforce/cli that allows repeat launches of the same persona to reuse the previous session's sandbox mount and a digest-validated launch plan, significantly reducing startup times. The changes include the addition of fast-launch.ts and its corresponding tests, as well as updating the @relayfile/local-mount dependency. Feedback on these changes suggests wrapping the validation phase of tryFastAgentLaunch in a try-catch block to prevent potential crashes from corrupted or manually edited launch plans. Additionally, it is recommended to normalize directory sizes to zero in statDigestOf to avoid filesystem-dependent mismatch noise and to document the limitations of using directory stats for change detection.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment threadpackages/cli/src/fast-launch.ts
Comment threadpackages/cli/src/fast-launch.ts

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:39ae62851b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment threadpackages/cli/src/cli.ts
Comment threadpackages/cli/src/cli-impl.ts
Comment threadpackages/cli/src/cli-impl.ts

@cubic-dev-aicubic-dev-aiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed

Not reviewed (too large): packages/cli/src/cli.ts (~4,751 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

Comment threadpackages/cli/src/fast-launch.ts
Comment threadpackages/cli/src/fast-launch.ts Outdated
Comment threadpackages/cli/package.json Outdated
Comment threadpackages/cli/src/fast-launch.ts
willwashburnand others added 2 commits July 12, 2026 22:26
- Corrupted/truncated launch plans fall back to the full launch instead
of throwing (blanket guard in tryFastAgentLaunch)
- Digest every persona JSON in every source layer, not just the winning
file: same-id layers merge, and in-place edits don't touch dir mtimes.
Directory digests pin size to 0 (filesystem-dependent noise)
- Path-form sidecars (claudeMd/agentsMd file refs) make a launch
ineligible for plan caching until those files join the digest set
- Park async child spawn errors in fast-launch so an early 'error' can't
crash during the heavy import and the session manager resolves 127
- A failed drain/sync-back after a clean harness exit returns exit code
1 instead of masquerading as success (matches the cold path)
- persona-kit: bump @relayfile/local-mount to ^0.11.0 so pnpm hoists a
single copy alongside the CLI's
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The relayfile release train shipped the fast-launch changes as 0.10.23
(lockstep patch), not the 0.11.0 this branch anticipated. Ranges in cli
and persona-kit now track ^0.10.23 and the lockfile resolves the
published package. Cold/warm E2E re-verified against the npm tarball:
2.8s cold, ~20ms warm to harness spawn in relay.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cli/src/cli-impl.ts`:
- Around line 1617-1629: Update resolveBinOnPath to split process.env.PATH using
the platform-specific path.delimiter instead of a hardcoded colon. Ensure
Windows resolution also considers executable extensions such as .cmd and .exe
when checking candidates, while preserving existing absolute-path and Unix
behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b5c5f8af-f917-4cb3-ac04-7cfd87a6104d

📥 Commits

Reviewing files that changed from the base of the PR and between 57ab062 and 3401fb2.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • CHANGELOG.md
  • packages/cli/package.json
  • packages/cli/src/cli-impl.ts
  • packages/cli/src/cli.test.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/fast-launch.test.ts
  • packages/cli/src/fast-launch.ts
  • packages/persona-kit/package.json

Comment threadpackages/cli/src/cli-impl.ts
Windows PATHEXT shims stay unresolved by design — the warm fast path
simply never engages there and launches take the full path.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@willwashburn
willwashburn merged commit c529294 into mainJul 13, 2026
3 checks passed
@willwashburn
willwashburn deleted the perf/launch-fast branch July 13, 2026 14:23
Sign up for freeto 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

@willwashburn
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

cli: warm fast path spawns the harness in ~20ms; 10x faster cold launches - #258

Merged
willwashburn merged 5 commits into
mainfrom
perf/launch-fast
Jul 13, 2026
Merged

cli: warm fast path spawns the harness in ~20ms; 10x faster cold launches#258
willwashburn merged 5 commits into
mainfrom
perf/launch-fast

Conversation

@willwashburn

@willwashburnwillwashburn commented Jul 13, 2026

Copy link
Copy Markdown
Member

What this is

agentworkforce agent <persona> spawns the harness in ~20ms on repeat launches and ~2.5s cold (relay repo; previously ~26s), with session teardown under 1s (previously ~11s).

Warm fast path

A successful mount session keeps its sandbox mount under ~/.agentworkforce/workforce/cache/warm-mounts/ together with a launch plan: the resolved spawn (absolute bin + argv + default-derived env), stat digests of every input that fed resolution (persona file, persona source dirs + config, .agentignore/.agentreadonly, local skill sources), pinned env vars, and the skill-cache fingerprint.

The next launch of the same selector runs a dependency-free entry (fast-launch.ts, node builtins only): validate the plan, claim the warm mount by atomic rename, spawn the harness. The heavy CLI module loads after the child is running, reattaches the mount with the previous session's exported autosync state, reconciles against the repo while the harness TUI boots (~600ms, well inside harness startup), re-verifies the plan against live resolution, and runs the normal metadata/drain/sync-back/re-warm flow on exit.

Plans hold no secrets by construction: eligibility refuses personas with env maps, mcpServers, ai-memory wiring, env-provided inputs, or (outside opencode, which ignores it) relay MCP config. Everything else — any flag, any digest mismatch, a set pinned env var, a due upstream-drift check, a lost rename race — falls back silently to the full launch, which rebuilds both plan and warm mount. AGENTWORKFORCE_NO_FAST=1 disables; AGENTWORKFORCE_PERF=1 prints launch-phase timings.

Cold path

  • Mounts populate via @relayfile/local-mountpopulation: 'auto' (git ls-files): 1,477 files instead of 38,561 in relay, and autosync starts from population-seeded state instead of byte-comparing every file pair (was 9.3s).
  • The skill-cache mirror no longer copies the install-time .npm-cache (41MB) into the mount.
  • Cloud subcommand handlers (deploy/invoke/runs/destroy/integrations/deployments) load lazily at dispatch — they pulled @agent-relay/cloud onto every launch (~180ms).
  • cli.ts is now a thin entry; the implementation lives in cli-impl.ts.

Verified end-to-end (relay repo, harness stubbed)

  • Warm spawn at +20.5ms; host-side edits made between sessions visible in the mount before the agent reads (reconcile completes ~600ms); agent writes sync back to the repo; deletions made between sessions propagate into the warm mount instead of resurrecting; editing the persona file forces the full path and the following launch is warm again.

Merge order

Requires @relayfile/local-mount0.11.0 (AgentWorkforce/relayfile#349): population, attachMount, exportState, and the external-teardown safety guard. Release relayfile first, then land this; install/CI here stays red until that version is on npm.

🤖 Generated with Claude Code

Review in cubic

…d launches
agent <persona> launches now keep the session's sandbox mount warm and
record a digest-validated launch plan. The next launch of the same
selector validates the plan with a handful of stats (~20ms including
node boot), claims the warm mount by atomic rename, and spawns the
harness immediately; the heavy CLI module loads afterward, reattaches
the mount with the previous session's autosync state, and reconciles
while the harness boots. Any change to the persona, source dirs,
skills, dotfiles, or pinned env falls back to the full path
(AGENTWORKFORCE_NO_FAST=1 disables).
Cold launches populate mounts from git ls-files (local-mount
population: 'auto'), start autosync from population-seeded state, skip
the npm cache when mirroring skills, and lazy-load cloud subcommand
handlers. In the relay repo: 26s -> 2.5s cold, ~20ms warm; teardown
11s -> <1s.
Requires @relayfile/local-mount ^0.11.0 (release upstream first).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitaiBot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

💤 Files selected but had no reviewable changes (1)
  • packages/cli/src/cli-impl.ts
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 19d480c9-5f7f-4e0f-a9b3-331472fdf397

📥 Commits

Reviewing files that changed from the base of the PR and between 3401fb2 and 6c6dc7e.

📒 Files selected for processing (1)
  • packages/cli/src/cli-impl.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The CLI implementation moves into cli-impl.ts, adds validated warm-session reuse through persisted launch plans, expands persona session and improvement workflows, updates the entrypoint delegation, and upgrades the local-mount dependency.

Changes

CLI runtime and warm launch

Layer / File(s)Summary
Warm launch plan and validation
packages/cli/src/fast-launch.ts, packages/cli/src/fast-launch.test.ts
Persisted launch plans validate CLI state, environment pins, filesystem digests, skill-cache markers, and warm-mount markers before spawning a resumed harness session.
Persona selection and interactive sessions
packages/cli/src/cli-impl.ts
Persona resolution, skill installation and caching, sandbox configuration, dry-run validation, interactive harness launching, autosync, and warm-plan preparation are implemented.
Resume, commands, and persona improvement
packages/cli/src/cli-impl.ts
Warm sessions can resume and drain safely; persona commands, transcript discovery, improver proposal validation, interactive acceptance, and guarded patch application are added.
Entrypoint delegation and package updates
packages/cli/src/cli.ts, packages/cli/src/cli.test.ts, packages/cli/package.json, packages/persona-kit/package.json, CHANGELOG.md
The entrypoint attempts the warm path before loading the full implementation, tests target the relocated module, and mount dependency and changelog entries are updated.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
participant User
participant CLI as cli.ts
participant Runtime as cli-impl.ts
participant Mount as sandbox mount
participant Harness
User->>CLI: agent selector
CLI->>Runtime: delegate normal launch
Runtime->>Mount: configure and populate mount
Runtime->>Harness: spawn interactive session
Harness-->>Runtime: session exit
Runtime->>Mount: autosync and prepare warm plan
Loading

Poem

I’m a bunny with a launch plan bright,
Reusing warm mounts through the night.
Skills hop in, sidecars align,
Digests guard each cached design.
Faster paws and cleaner flow—
Off to the next persona we go!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 23.53% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Title check✅ PassedThe title accurately summarizes the warm fast path and cold-launch speedups in the CLI.
Description check✅ PassedThe description is directly about the CLI fast path, cold-launch optimizations, and dependency update.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/launch-fast

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…module load
The harness child spawns before cli-impl loads; a child that exits
during that import has already emitted 'close', so the resume must read
the settled exitCode/signalCode instead of waiting forever for an event
that fired with no listener.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@gemini-code-assistgemini-code-assistBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a warm-launch fast path for @agentworkforce/cli that allows repeat launches of the same persona to reuse the previous session's sandbox mount and a digest-validated launch plan, significantly reducing startup times. The changes include the addition of fast-launch.ts and its corresponding tests, as well as updating the @relayfile/local-mount dependency. Feedback on these changes suggests wrapping the validation phase of tryFastAgentLaunch in a try-catch block to prevent potential crashes from corrupted or manually edited launch plans. Additionally, it is recommended to normalize directory sizes to zero in statDigestOf to avoid filesystem-dependent mismatch noise and to document the limitations of using directory stats for change detection.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment threadpackages/cli/src/fast-launch.ts
Comment threadpackages/cli/src/fast-launch.ts

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:39ae62851b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment threadpackages/cli/src/cli.ts
Comment threadpackages/cli/src/cli-impl.ts
Comment threadpackages/cli/src/cli-impl.ts

@cubic-dev-aicubic-dev-aiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed

Not reviewed (too large): packages/cli/src/cli.ts (~4,751 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

Comment threadpackages/cli/src/fast-launch.ts
Comment threadpackages/cli/src/fast-launch.ts Outdated
Comment threadpackages/cli/package.json Outdated
Comment threadpackages/cli/src/fast-launch.ts
willwashburnand others added 2 commits July 12, 2026 22:26
- Corrupted/truncated launch plans fall back to the full launch instead
of throwing (blanket guard in tryFastAgentLaunch)
- Digest every persona JSON in every source layer, not just the winning
file: same-id layers merge, and in-place edits don't touch dir mtimes.
Directory digests pin size to 0 (filesystem-dependent noise)
- Path-form sidecars (claudeMd/agentsMd file refs) make a launch
ineligible for plan caching until those files join the digest set
- Park async child spawn errors in fast-launch so an early 'error' can't
crash during the heavy import and the session manager resolves 127
- A failed drain/sync-back after a clean harness exit returns exit code
1 instead of masquerading as success (matches the cold path)
- persona-kit: bump @relayfile/local-mount to ^0.11.0 so pnpm hoists a
single copy alongside the CLI's
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The relayfile release train shipped the fast-launch changes as 0.10.23
(lockstep patch), not the 0.11.0 this branch anticipated. Ranges in cli
and persona-kit now track ^0.10.23 and the lockfile resolves the
published package. Cold/warm E2E re-verified against the npm tarball:
2.8s cold, ~20ms warm to harness spawn in relay.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cli/src/cli-impl.ts`:
- Around line 1617-1629: Update resolveBinOnPath to split process.env.PATH using
the platform-specific path.delimiter instead of a hardcoded colon. Ensure
Windows resolution also considers executable extensions such as .cmd and .exe
when checking candidates, while preserving existing absolute-path and Unix
behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b5c5f8af-f917-4cb3-ac04-7cfd87a6104d

📥 Commits

Reviewing files that changed from the base of the PR and between 57ab062 and 3401fb2.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • CHANGELOG.md
  • packages/cli/package.json
  • packages/cli/src/cli-impl.ts
  • packages/cli/src/cli.test.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/fast-launch.test.ts
  • packages/cli/src/fast-launch.ts
  • packages/persona-kit/package.json

Comment threadpackages/cli/src/cli-impl.ts
Windows PATHEXT shims stay unresolved by design — the warm fast path
simply never engages there and launches take the full path.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@willwashburn
willwashburn merged commit c529294 into mainJul 13, 2026
3 checks passed
@willwashburn
willwashburn deleted the perf/launch-fast branch July 13, 2026 14:23
Sign up for freeto 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

@willwashburn
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

cli: warm fast path spawns the harness in ~20ms; 10x faster cold launches - #258

Merged
willwashburn merged 5 commits into
mainfrom
perf/launch-fast
Jul 13, 2026
Merged

cli: warm fast path spawns the harness in ~20ms; 10x faster cold launches#258
willwashburn merged 5 commits into
mainfrom
perf/launch-fast

Conversation

@willwashburn

@willwashburnwillwashburn commented Jul 13, 2026

Copy link
Copy Markdown
Member

What this is

agentworkforce agent <persona> spawns the harness in ~20ms on repeat launches and ~2.5s cold (relay repo; previously ~26s), with session teardown under 1s (previously ~11s).

Warm fast path

A successful mount session keeps its sandbox mount under ~/.agentworkforce/workforce/cache/warm-mounts/ together with a launch plan: the resolved spawn (absolute bin + argv + default-derived env), stat digests of every input that fed resolution (persona file, persona source dirs + config, .agentignore/.agentreadonly, local skill sources), pinned env vars, and the skill-cache fingerprint.

The next launch of the same selector runs a dependency-free entry (fast-launch.ts, node builtins only): validate the plan, claim the warm mount by atomic rename, spawn the harness. The heavy CLI module loads after the child is running, reattaches the mount with the previous session's exported autosync state, reconciles against the repo while the harness TUI boots (~600ms, well inside harness startup), re-verifies the plan against live resolution, and runs the normal metadata/drain/sync-back/re-warm flow on exit.

Plans hold no secrets by construction: eligibility refuses personas with env maps, mcpServers, ai-memory wiring, env-provided inputs, or (outside opencode, which ignores it) relay MCP config. Everything else — any flag, any digest mismatch, a set pinned env var, a due upstream-drift check, a lost rename race — falls back silently to the full launch, which rebuilds both plan and warm mount. AGENTWORKFORCE_NO_FAST=1 disables; AGENTWORKFORCE_PERF=1 prints launch-phase timings.

Cold path

  • Mounts populate via @relayfile/local-mountpopulation: 'auto' (git ls-files): 1,477 files instead of 38,561 in relay, and autosync starts from population-seeded state instead of byte-comparing every file pair (was 9.3s).
  • The skill-cache mirror no longer copies the install-time .npm-cache (41MB) into the mount.
  • Cloud subcommand handlers (deploy/invoke/runs/destroy/integrations/deployments) load lazily at dispatch — they pulled @agent-relay/cloud onto every launch (~180ms).
  • cli.ts is now a thin entry; the implementation lives in cli-impl.ts.

Verified end-to-end (relay repo, harness stubbed)

  • Warm spawn at +20.5ms; host-side edits made between sessions visible in the mount before the agent reads (reconcile completes ~600ms); agent writes sync back to the repo; deletions made between sessions propagate into the warm mount instead of resurrecting; editing the persona file forces the full path and the following launch is warm again.

Merge order

Requires @relayfile/local-mount0.11.0 (AgentWorkforce/relayfile#349): population, attachMount, exportState, and the external-teardown safety guard. Release relayfile first, then land this; install/CI here stays red until that version is on npm.

🤖 Generated with Claude Code

Review in cubic

…d launches
agent <persona> launches now keep the session's sandbox mount warm and
record a digest-validated launch plan. The next launch of the same
selector validates the plan with a handful of stats (~20ms including
node boot), claims the warm mount by atomic rename, and spawns the
harness immediately; the heavy CLI module loads afterward, reattaches
the mount with the previous session's autosync state, and reconciles
while the harness boots. Any change to the persona, source dirs,
skills, dotfiles, or pinned env falls back to the full path
(AGENTWORKFORCE_NO_FAST=1 disables).
Cold launches populate mounts from git ls-files (local-mount
population: 'auto'), start autosync from population-seeded state, skip
the npm cache when mirroring skills, and lazy-load cloud subcommand
handlers. In the relay repo: 26s -> 2.5s cold, ~20ms warm; teardown
11s -> <1s.
Requires @relayfile/local-mount ^0.11.0 (release upstream first).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitaiBot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

💤 Files selected but had no reviewable changes (1)
  • packages/cli/src/cli-impl.ts
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 19d480c9-5f7f-4e0f-a9b3-331472fdf397

📥 Commits

Reviewing files that changed from the base of the PR and between 3401fb2 and 6c6dc7e.

📒 Files selected for processing (1)
  • packages/cli/src/cli-impl.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The CLI implementation moves into cli-impl.ts, adds validated warm-session reuse through persisted launch plans, expands persona session and improvement workflows, updates the entrypoint delegation, and upgrades the local-mount dependency.

Changes

CLI runtime and warm launch

Layer / File(s)Summary
Warm launch plan and validation
packages/cli/src/fast-launch.ts, packages/cli/src/fast-launch.test.ts
Persisted launch plans validate CLI state, environment pins, filesystem digests, skill-cache markers, and warm-mount markers before spawning a resumed harness session.
Persona selection and interactive sessions
packages/cli/src/cli-impl.ts
Persona resolution, skill installation and caching, sandbox configuration, dry-run validation, interactive harness launching, autosync, and warm-plan preparation are implemented.
Resume, commands, and persona improvement
packages/cli/src/cli-impl.ts
Warm sessions can resume and drain safely; persona commands, transcript discovery, improver proposal validation, interactive acceptance, and guarded patch application are added.
Entrypoint delegation and package updates
packages/cli/src/cli.ts, packages/cli/src/cli.test.ts, packages/cli/package.json, packages/persona-kit/package.json, CHANGELOG.md
The entrypoint attempts the warm path before loading the full implementation, tests target the relocated module, and mount dependency and changelog entries are updated.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
participant User
participant CLI as cli.ts
participant Runtime as cli-impl.ts
participant Mount as sandbox mount
participant Harness
User->>CLI: agent selector
CLI->>Runtime: delegate normal launch
Runtime->>Mount: configure and populate mount
Runtime->>Harness: spawn interactive session
Harness-->>Runtime: session exit
Runtime->>Mount: autosync and prepare warm plan
Loading

Poem

I’m a bunny with a launch plan bright,
Reusing warm mounts through the night.
Skills hop in, sidecars align,
Digests guard each cached design.
Faster paws and cleaner flow—
Off to the next persona we go!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 23.53% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Title check✅ PassedThe title accurately summarizes the warm fast path and cold-launch speedups in the CLI.
Description check✅ PassedThe description is directly about the CLI fast path, cold-launch optimizations, and dependency update.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/launch-fast

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…module load
The harness child spawns before cli-impl loads; a child that exits
during that import has already emitted 'close', so the resume must read
the settled exitCode/signalCode instead of waiting forever for an event
that fired with no listener.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@gemini-code-assistgemini-code-assistBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a warm-launch fast path for @agentworkforce/cli that allows repeat launches of the same persona to reuse the previous session's sandbox mount and a digest-validated launch plan, significantly reducing startup times. The changes include the addition of fast-launch.ts and its corresponding tests, as well as updating the @relayfile/local-mount dependency. Feedback on these changes suggests wrapping the validation phase of tryFastAgentLaunch in a try-catch block to prevent potential crashes from corrupted or manually edited launch plans. Additionally, it is recommended to normalize directory sizes to zero in statDigestOf to avoid filesystem-dependent mismatch noise and to document the limitations of using directory stats for change detection.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment threadpackages/cli/src/fast-launch.ts
Comment threadpackages/cli/src/fast-launch.ts

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:39ae62851b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment threadpackages/cli/src/cli.ts
Comment threadpackages/cli/src/cli-impl.ts
Comment threadpackages/cli/src/cli-impl.ts

@cubic-dev-aicubic-dev-aiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed

Not reviewed (too large): packages/cli/src/cli.ts (~4,751 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

Comment threadpackages/cli/src/fast-launch.ts
Comment threadpackages/cli/src/fast-launch.ts Outdated
Comment threadpackages/cli/package.json Outdated
Comment threadpackages/cli/src/fast-launch.ts
willwashburnand others added 2 commits July 12, 2026 22:26
- Corrupted/truncated launch plans fall back to the full launch instead
of throwing (blanket guard in tryFastAgentLaunch)
- Digest every persona JSON in every source layer, not just the winning
file: same-id layers merge, and in-place edits don't touch dir mtimes.
Directory digests pin size to 0 (filesystem-dependent noise)
- Path-form sidecars (claudeMd/agentsMd file refs) make a launch
ineligible for plan caching until those files join the digest set
- Park async child spawn errors in fast-launch so an early 'error' can't
crash during the heavy import and the session manager resolves 127
- A failed drain/sync-back after a clean harness exit returns exit code
1 instead of masquerading as success (matches the cold path)
- persona-kit: bump @relayfile/local-mount to ^0.11.0 so pnpm hoists a
single copy alongside the CLI's
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The relayfile release train shipped the fast-launch changes as 0.10.23
(lockstep patch), not the 0.11.0 this branch anticipated. Ranges in cli
and persona-kit now track ^0.10.23 and the lockfile resolves the
published package. Cold/warm E2E re-verified against the npm tarball:
2.8s cold, ~20ms warm to harness spawn in relay.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cli/src/cli-impl.ts`:
- Around line 1617-1629: Update resolveBinOnPath to split process.env.PATH using
the platform-specific path.delimiter instead of a hardcoded colon. Ensure
Windows resolution also considers executable extensions such as .cmd and .exe
when checking candidates, while preserving existing absolute-path and Unix
behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b5c5f8af-f917-4cb3-ac04-7cfd87a6104d

📥 Commits

Reviewing files that changed from the base of the PR and between 57ab062 and 3401fb2.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • CHANGELOG.md
  • packages/cli/package.json
  • packages/cli/src/cli-impl.ts
  • packages/cli/src/cli.test.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/fast-launch.test.ts
  • packages/cli/src/fast-launch.ts
  • packages/persona-kit/package.json

Comment threadpackages/cli/src/cli-impl.ts
Windows PATHEXT shims stay unresolved by design — the warm fast path
simply never engages there and launches take the full path.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@willwashburn
willwashburn merged commit c529294 into mainJul 13, 2026
3 checks passed
@willwashburn
willwashburn deleted the perf/launch-fast branch July 13, 2026 14:23
Sign up for freeto 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

@willwashburn
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

cli: warm fast path spawns the harness in ~20ms; 10x faster cold launches - #258

Merged
willwashburn merged 5 commits into
mainfrom
perf/launch-fast
Jul 13, 2026
Merged

cli: warm fast path spawns the harness in ~20ms; 10x faster cold launches#258
willwashburn merged 5 commits into
mainfrom
perf/launch-fast

Conversation

@willwashburn

@willwashburnwillwashburn commented Jul 13, 2026

Copy link
Copy Markdown
Member

What this is

agentworkforce agent <persona> spawns the harness in ~20ms on repeat launches and ~2.5s cold (relay repo; previously ~26s), with session teardown under 1s (previously ~11s).

Warm fast path

A successful mount session keeps its sandbox mount under ~/.agentworkforce/workforce/cache/warm-mounts/ together with a launch plan: the resolved spawn (absolute bin + argv + default-derived env), stat digests of every input that fed resolution (persona file, persona source dirs + config, .agentignore/.agentreadonly, local skill sources), pinned env vars, and the skill-cache fingerprint.

The next launch of the same selector runs a dependency-free entry (fast-launch.ts, node builtins only): validate the plan, claim the warm mount by atomic rename, spawn the harness. The heavy CLI module loads after the child is running, reattaches the mount with the previous session's exported autosync state, reconciles against the repo while the harness TUI boots (~600ms, well inside harness startup), re-verifies the plan against live resolution, and runs the normal metadata/drain/sync-back/re-warm flow on exit.

Plans hold no secrets by construction: eligibility refuses personas with env maps, mcpServers, ai-memory wiring, env-provided inputs, or (outside opencode, which ignores it) relay MCP config. Everything else — any flag, any digest mismatch, a set pinned env var, a due upstream-drift check, a lost rename race — falls back silently to the full launch, which rebuilds both plan and warm mount. AGENTWORKFORCE_NO_FAST=1 disables; AGENTWORKFORCE_PERF=1 prints launch-phase timings.

Cold path

  • Mounts populate via @relayfile/local-mountpopulation: 'auto' (git ls-files): 1,477 files instead of 38,561 in relay, and autosync starts from population-seeded state instead of byte-comparing every file pair (was 9.3s).
  • The skill-cache mirror no longer copies the install-time .npm-cache (41MB) into the mount.
  • Cloud subcommand handlers (deploy/invoke/runs/destroy/integrations/deployments) load lazily at dispatch — they pulled @agent-relay/cloud onto every launch (~180ms).
  • cli.ts is now a thin entry; the implementation lives in cli-impl.ts.

Verified end-to-end (relay repo, harness stubbed)

  • Warm spawn at +20.5ms; host-side edits made between sessions visible in the mount before the agent reads (reconcile completes ~600ms); agent writes sync back to the repo; deletions made between sessions propagate into the warm mount instead of resurrecting; editing the persona file forces the full path and the following launch is warm again.

Merge order

Requires @relayfile/local-mount0.11.0 (AgentWorkforce/relayfile#349): population, attachMount, exportState, and the external-teardown safety guard. Release relayfile first, then land this; install/CI here stays red until that version is on npm.

🤖 Generated with Claude Code

Review in cubic

…d launches
agent <persona> launches now keep the session's sandbox mount warm and
record a digest-validated launch plan. The next launch of the same
selector validates the plan with a handful of stats (~20ms including
node boot), claims the warm mount by atomic rename, and spawns the
harness immediately; the heavy CLI module loads afterward, reattaches
the mount with the previous session's autosync state, and reconciles
while the harness boots. Any change to the persona, source dirs,
skills, dotfiles, or pinned env falls back to the full path
(AGENTWORKFORCE_NO_FAST=1 disables).
Cold launches populate mounts from git ls-files (local-mount
population: 'auto'), start autosync from population-seeded state, skip
the npm cache when mirroring skills, and lazy-load cloud subcommand
handlers. In the relay repo: 26s -> 2.5s cold, ~20ms warm; teardown
11s -> <1s.
Requires @relayfile/local-mount ^0.11.0 (release upstream first).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitaiBot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

💤 Files selected but had no reviewable changes (1)
  • packages/cli/src/cli-impl.ts
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 19d480c9-5f7f-4e0f-a9b3-331472fdf397

📥 Commits

Reviewing files that changed from the base of the PR and between 3401fb2 and 6c6dc7e.

📒 Files selected for processing (1)
  • packages/cli/src/cli-impl.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The CLI implementation moves into cli-impl.ts, adds validated warm-session reuse through persisted launch plans, expands persona session and improvement workflows, updates the entrypoint delegation, and upgrades the local-mount dependency.

Changes

CLI runtime and warm launch

Layer / File(s)Summary
Warm launch plan and validation
packages/cli/src/fast-launch.ts, packages/cli/src/fast-launch.test.ts
Persisted launch plans validate CLI state, environment pins, filesystem digests, skill-cache markers, and warm-mount markers before spawning a resumed harness session.
Persona selection and interactive sessions
packages/cli/src/cli-impl.ts
Persona resolution, skill installation and caching, sandbox configuration, dry-run validation, interactive harness launching, autosync, and warm-plan preparation are implemented.
Resume, commands, and persona improvement
packages/cli/src/cli-impl.ts
Warm sessions can resume and drain safely; persona commands, transcript discovery, improver proposal validation, interactive acceptance, and guarded patch application are added.
Entrypoint delegation and package updates
packages/cli/src/cli.ts, packages/cli/src/cli.test.ts, packages/cli/package.json, packages/persona-kit/package.json, CHANGELOG.md
The entrypoint attempts the warm path before loading the full implementation, tests target the relocated module, and mount dependency and changelog entries are updated.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
participant User
participant CLI as cli.ts
participant Runtime as cli-impl.ts
participant Mount as sandbox mount
participant Harness
User->>CLI: agent selector
CLI->>Runtime: delegate normal launch
Runtime->>Mount: configure and populate mount
Runtime->>Harness: spawn interactive session
Harness-->>Runtime: session exit
Runtime->>Mount: autosync and prepare warm plan
Loading

Poem

I’m a bunny with a launch plan bright,
Reusing warm mounts through the night.
Skills hop in, sidecars align,
Digests guard each cached design.
Faster paws and cleaner flow—
Off to the next persona we go!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 23.53% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Title check✅ PassedThe title accurately summarizes the warm fast path and cold-launch speedups in the CLI.
Description check✅ PassedThe description is directly about the CLI fast path, cold-launch optimizations, and dependency update.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/launch-fast

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…module load
The harness child spawns before cli-impl loads; a child that exits
during that import has already emitted 'close', so the resume must read
the settled exitCode/signalCode instead of waiting forever for an event
that fired with no listener.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@gemini-code-assistgemini-code-assistBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a warm-launch fast path for @agentworkforce/cli that allows repeat launches of the same persona to reuse the previous session's sandbox mount and a digest-validated launch plan, significantly reducing startup times. The changes include the addition of fast-launch.ts and its corresponding tests, as well as updating the @relayfile/local-mount dependency. Feedback on these changes suggests wrapping the validation phase of tryFastAgentLaunch in a try-catch block to prevent potential crashes from corrupted or manually edited launch plans. Additionally, it is recommended to normalize directory sizes to zero in statDigestOf to avoid filesystem-dependent mismatch noise and to document the limitations of using directory stats for change detection.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment threadpackages/cli/src/fast-launch.ts
Comment threadpackages/cli/src/fast-launch.ts

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:39ae62851b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment threadpackages/cli/src/cli.ts
Comment threadpackages/cli/src/cli-impl.ts
Comment threadpackages/cli/src/cli-impl.ts

@cubic-dev-aicubic-dev-aiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed

Not reviewed (too large): packages/cli/src/cli.ts (~4,751 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

Comment threadpackages/cli/src/fast-launch.ts
Comment threadpackages/cli/src/fast-launch.ts Outdated
Comment threadpackages/cli/package.json Outdated
Comment threadpackages/cli/src/fast-launch.ts
willwashburnand others added 2 commits July 12, 2026 22:26
- Corrupted/truncated launch plans fall back to the full launch instead
of throwing (blanket guard in tryFastAgentLaunch)
- Digest every persona JSON in every source layer, not just the winning
file: same-id layers merge, and in-place edits don't touch dir mtimes.
Directory digests pin size to 0 (filesystem-dependent noise)
- Path-form sidecars (claudeMd/agentsMd file refs) make a launch
ineligible for plan caching until those files join the digest set
- Park async child spawn errors in fast-launch so an early 'error' can't
crash during the heavy import and the session manager resolves 127
- A failed drain/sync-back after a clean harness exit returns exit code
1 instead of masquerading as success (matches the cold path)
- persona-kit: bump @relayfile/local-mount to ^0.11.0 so pnpm hoists a
single copy alongside the CLI's
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The relayfile release train shipped the fast-launch changes as 0.10.23
(lockstep patch), not the 0.11.0 this branch anticipated. Ranges in cli
and persona-kit now track ^0.10.23 and the lockfile resolves the
published package. Cold/warm E2E re-verified against the npm tarball:
2.8s cold, ~20ms warm to harness spawn in relay.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cli/src/cli-impl.ts`:
- Around line 1617-1629: Update resolveBinOnPath to split process.env.PATH using
the platform-specific path.delimiter instead of a hardcoded colon. Ensure
Windows resolution also considers executable extensions such as .cmd and .exe
when checking candidates, while preserving existing absolute-path and Unix
behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b5c5f8af-f917-4cb3-ac04-7cfd87a6104d

📥 Commits

Reviewing files that changed from the base of the PR and between 57ab062 and 3401fb2.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • CHANGELOG.md
  • packages/cli/package.json
  • packages/cli/src/cli-impl.ts
  • packages/cli/src/cli.test.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/fast-launch.test.ts
  • packages/cli/src/fast-launch.ts
  • packages/persona-kit/package.json

Comment threadpackages/cli/src/cli-impl.ts
Windows PATHEXT shims stay unresolved by design — the warm fast path
simply never engages there and launches take the full path.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@willwashburn
willwashburn merged commit c529294 into mainJul 13, 2026
3 checks passed
@willwashburn
willwashburn deleted the perf/launch-fast branch July 13, 2026 14:23
Sign up for freeto 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

@willwashburn
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

cli: warm fast path spawns the harness in ~20ms; 10x faster cold launches - #258

Merged
willwashburn merged 5 commits into
mainfrom
perf/launch-fast
Jul 13, 2026
Merged

cli: warm fast path spawns the harness in ~20ms; 10x faster cold launches#258
willwashburn merged 5 commits into
mainfrom
perf/launch-fast

Conversation

@willwashburn

@willwashburnwillwashburn commented Jul 13, 2026

Copy link
Copy Markdown
Member

What this is

agentworkforce agent <persona> spawns the harness in ~20ms on repeat launches and ~2.5s cold (relay repo; previously ~26s), with session teardown under 1s (previously ~11s).

Warm fast path

A successful mount session keeps its sandbox mount under ~/.agentworkforce/workforce/cache/warm-mounts/ together with a launch plan: the resolved spawn (absolute bin + argv + default-derived env), stat digests of every input that fed resolution (persona file, persona source dirs + config, .agentignore/.agentreadonly, local skill sources), pinned env vars, and the skill-cache fingerprint.

The next launch of the same selector runs a dependency-free entry (fast-launch.ts, node builtins only): validate the plan, claim the warm mount by atomic rename, spawn the harness. The heavy CLI module loads after the child is running, reattaches the mount with the previous session's exported autosync state, reconciles against the repo while the harness TUI boots (~600ms, well inside harness startup), re-verifies the plan against live resolution, and runs the normal metadata/drain/sync-back/re-warm flow on exit.

Plans hold no secrets by construction: eligibility refuses personas with env maps, mcpServers, ai-memory wiring, env-provided inputs, or (outside opencode, which ignores it) relay MCP config. Everything else — any flag, any digest mismatch, a set pinned env var, a due upstream-drift check, a lost rename race — falls back silently to the full launch, which rebuilds both plan and warm mount. AGENTWORKFORCE_NO_FAST=1 disables; AGENTWORKFORCE_PERF=1 prints launch-phase timings.

Cold path

  • Mounts populate via @relayfile/local-mountpopulation: 'auto' (git ls-files): 1,477 files instead of 38,561 in relay, and autosync starts from population-seeded state instead of byte-comparing every file pair (was 9.3s).
  • The skill-cache mirror no longer copies the install-time .npm-cache (41MB) into the mount.
  • Cloud subcommand handlers (deploy/invoke/runs/destroy/integrations/deployments) load lazily at dispatch — they pulled @agent-relay/cloud onto every launch (~180ms).
  • cli.ts is now a thin entry; the implementation lives in cli-impl.ts.

Verified end-to-end (relay repo, harness stubbed)

  • Warm spawn at +20.5ms; host-side edits made between sessions visible in the mount before the agent reads (reconcile completes ~600ms); agent writes sync back to the repo; deletions made between sessions propagate into the warm mount instead of resurrecting; editing the persona file forces the full path and the following launch is warm again.

Merge order

Requires @relayfile/local-mount0.11.0 (AgentWorkforce/relayfile#349): population, attachMount, exportState, and the external-teardown safety guard. Release relayfile first, then land this; install/CI here stays red until that version is on npm.

🤖 Generated with Claude Code

Review in cubic

…d launches
agent <persona> launches now keep the session's sandbox mount warm and
record a digest-validated launch plan. The next launch of the same
selector validates the plan with a handful of stats (~20ms including
node boot), claims the warm mount by atomic rename, and spawns the
harness immediately; the heavy CLI module loads afterward, reattaches
the mount with the previous session's autosync state, and reconciles
while the harness boots. Any change to the persona, source dirs,
skills, dotfiles, or pinned env falls back to the full path
(AGENTWORKFORCE_NO_FAST=1 disables).
Cold launches populate mounts from git ls-files (local-mount
population: 'auto'), start autosync from population-seeded state, skip
the npm cache when mirroring skills, and lazy-load cloud subcommand
handlers. In the relay repo: 26s -> 2.5s cold, ~20ms warm; teardown
11s -> <1s.
Requires @relayfile/local-mount ^0.11.0 (release upstream first).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitaiBot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

💤 Files selected but had no reviewable changes (1)
  • packages/cli/src/cli-impl.ts
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 19d480c9-5f7f-4e0f-a9b3-331472fdf397

📥 Commits

Reviewing files that changed from the base of the PR and between 3401fb2 and 6c6dc7e.

📒 Files selected for processing (1)
  • packages/cli/src/cli-impl.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The CLI implementation moves into cli-impl.ts, adds validated warm-session reuse through persisted launch plans, expands persona session and improvement workflows, updates the entrypoint delegation, and upgrades the local-mount dependency.

Changes

CLI runtime and warm launch

Layer / File(s)Summary
Warm launch plan and validation
packages/cli/src/fast-launch.ts, packages/cli/src/fast-launch.test.ts
Persisted launch plans validate CLI state, environment pins, filesystem digests, skill-cache markers, and warm-mount markers before spawning a resumed harness session.
Persona selection and interactive sessions
packages/cli/src/cli-impl.ts
Persona resolution, skill installation and caching, sandbox configuration, dry-run validation, interactive harness launching, autosync, and warm-plan preparation are implemented.
Resume, commands, and persona improvement
packages/cli/src/cli-impl.ts
Warm sessions can resume and drain safely; persona commands, transcript discovery, improver proposal validation, interactive acceptance, and guarded patch application are added.
Entrypoint delegation and package updates
packages/cli/src/cli.ts, packages/cli/src/cli.test.ts, packages/cli/package.json, packages/persona-kit/package.json, CHANGELOG.md
The entrypoint attempts the warm path before loading the full implementation, tests target the relocated module, and mount dependency and changelog entries are updated.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
participant User
participant CLI as cli.ts
participant Runtime as cli-impl.ts
participant Mount as sandbox mount
participant Harness
User->>CLI: agent selector
CLI->>Runtime: delegate normal launch
Runtime->>Mount: configure and populate mount
Runtime->>Harness: spawn interactive session
Harness-->>Runtime: session exit
Runtime->>Mount: autosync and prepare warm plan
Loading

Poem

I’m a bunny with a launch plan bright,
Reusing warm mounts through the night.
Skills hop in, sidecars align,
Digests guard each cached design.
Faster paws and cleaner flow—
Off to the next persona we go!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 23.53% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Title check✅ PassedThe title accurately summarizes the warm fast path and cold-launch speedups in the CLI.
Description check✅ PassedThe description is directly about the CLI fast path, cold-launch optimizations, and dependency update.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/launch-fast

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…module load
The harness child spawns before cli-impl loads; a child that exits
during that import has already emitted 'close', so the resume must read
the settled exitCode/signalCode instead of waiting forever for an event
that fired with no listener.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@gemini-code-assistgemini-code-assistBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a warm-launch fast path for @agentworkforce/cli that allows repeat launches of the same persona to reuse the previous session's sandbox mount and a digest-validated launch plan, significantly reducing startup times. The changes include the addition of fast-launch.ts and its corresponding tests, as well as updating the @relayfile/local-mount dependency. Feedback on these changes suggests wrapping the validation phase of tryFastAgentLaunch in a try-catch block to prevent potential crashes from corrupted or manually edited launch plans. Additionally, it is recommended to normalize directory sizes to zero in statDigestOf to avoid filesystem-dependent mismatch noise and to document the limitations of using directory stats for change detection.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment threadpackages/cli/src/fast-launch.ts
Comment threadpackages/cli/src/fast-launch.ts

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:39ae62851b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment threadpackages/cli/src/cli.ts
Comment threadpackages/cli/src/cli-impl.ts
Comment threadpackages/cli/src/cli-impl.ts

@cubic-dev-aicubic-dev-aiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed

Not reviewed (too large): packages/cli/src/cli.ts (~4,751 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

Comment threadpackages/cli/src/fast-launch.ts
Comment threadpackages/cli/src/fast-launch.ts Outdated
Comment threadpackages/cli/package.json Outdated
Comment threadpackages/cli/src/fast-launch.ts
willwashburnand others added 2 commits July 12, 2026 22:26
- Corrupted/truncated launch plans fall back to the full launch instead
of throwing (blanket guard in tryFastAgentLaunch)
- Digest every persona JSON in every source layer, not just the winning
file: same-id layers merge, and in-place edits don't touch dir mtimes.
Directory digests pin size to 0 (filesystem-dependent noise)
- Path-form sidecars (claudeMd/agentsMd file refs) make a launch
ineligible for plan caching until those files join the digest set
- Park async child spawn errors in fast-launch so an early 'error' can't
crash during the heavy import and the session manager resolves 127
- A failed drain/sync-back after a clean harness exit returns exit code
1 instead of masquerading as success (matches the cold path)
- persona-kit: bump @relayfile/local-mount to ^0.11.0 so pnpm hoists a
single copy alongside the CLI's
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The relayfile release train shipped the fast-launch changes as 0.10.23
(lockstep patch), not the 0.11.0 this branch anticipated. Ranges in cli
and persona-kit now track ^0.10.23 and the lockfile resolves the
published package. Cold/warm E2E re-verified against the npm tarball:
2.8s cold, ~20ms warm to harness spawn in relay.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cli/src/cli-impl.ts`:
- Around line 1617-1629: Update resolveBinOnPath to split process.env.PATH using
the platform-specific path.delimiter instead of a hardcoded colon. Ensure
Windows resolution also considers executable extensions such as .cmd and .exe
when checking candidates, while preserving existing absolute-path and Unix
behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b5c5f8af-f917-4cb3-ac04-7cfd87a6104d

📥 Commits

Reviewing files that changed from the base of the PR and between 57ab062 and 3401fb2.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • CHANGELOG.md
  • packages/cli/package.json
  • packages/cli/src/cli-impl.ts
  • packages/cli/src/cli.test.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/fast-launch.test.ts
  • packages/cli/src/fast-launch.ts
  • packages/persona-kit/package.json

Comment threadpackages/cli/src/cli-impl.ts
Windows PATHEXT shims stay unresolved by design — the warm fast path
simply never engages there and launches take the full path.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@willwashburn
willwashburn merged commit c529294 into mainJul 13, 2026
3 checks passed
@willwashburn
willwashburn deleted the perf/launch-fast branch July 13, 2026 14:23
Sign up for freeto 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

@willwashburn