Skip to content

Export profile-only launch mode and skip the lane guard - #126

Merged
brettheap merged 4 commits into
mainfrom
017-export-no-lane-mode
Sep 30, 2026
Merged

brettheap merged 4 commits into
mainfrom
017-export-no-lane-mode

Conversation

@brettheap

@brettheap brettheap commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Make the launched Claude process carry its actual lane mode:

  • Export CLAUDE_NO_LANE=1 for profile-only launches and bare fallbacks.
  • Clear an inherited opt-out when an explicit lane request starts a lane.
  • Keep explicit --no-lane authoritative regardless of option order.
  • Preserve launch mode across actual tmux child invocations.

Vendors merged opensoft/openRepoTools#135 at main commit
a7d125716829dcc24b009e464d919a3e404afba4, using the canonical
update-upstream.py apply command. Shared profile hooks remain installed.

Verification

  • Binary selection and launch modes passed, including all 72 current-Claude checks.
  • Name guard hook: 27 scenarios, 59 assertions passed.
  • Lane defaults: 49 scenarios, 206 assertions passed for each launcher entry point.
  • Amendment 11: 111 scenarios, 467 assertions passed.
  • Bash syntax, diff checks and strict OpenSpec validation passed.
  • All 21 vendored copies match their pins; the estate installer regression passed.
  • The launcher subprocess exercises the actual vendored guard: it fails with
    the old pin and passes with the marker-aware pin.

Governance: openspec/changes/export-no-lane-mode/.
Implementation: specs/017-export-no-lane-mode/.

This session is outside a lane under brettheap/new-workstation#47, which makes
lane attribution conditional on actual lane membership.

Summary by Sourcery

Propagate the actual lane mode to Claude launches so profile-only sessions skip lane enforcement while explicit lane requests retain precedence.

New Features:

  • Publish the selected no-lane mode to launched Claude processes through CLAUDE_NO_LANE=1.
  • Allow profile-only launches to bypass lane prompt guards while retaining shared profile hooks.

Bug Fixes:

  • Ensure inherited no-lane state is cleared for explicit lane launches and that explicit --no-lane remains authoritative regardless of option order.
  • Preserve launch mode across tmux relaunches and bare fallbacks after refused lane handoffs.

Enhancements:

  • Update the vendored openRepoTools guard and launcher documentation to support the new launch-mode contract.

Documentation:

  • Document profile-only mode, lane-mode precedence, and the CLAUDE_NO_LANE environment contract.

Tests:

  • Extend launcher regressions to cover direct launches, tmux children, inherited mode, conflicting options, guard integration, and fallback behavior.

Chores:

  • Add the OpenSpec governance and implementation records for publishing launch mode.

Copilot AI balanced review requested due to automatic review settings September 30, 2026 18:01
@sourcery-ai

sourcery-ai Bot commented Sep 30, 2026

Copy link
Copy Markdown

Reviewer's Guide

The PR makes the launched Claude process explicitly identify profile-only mode, normalizes inherited and explicit lane options with deterministic precedence, clears the exemption during lane handoff, and carries the mode through tmux and fallback paths. It adds focused launcher regressions, updates user-facing documentation, and records the OpenSpec/Speckit implementation and verification artifacts; review should also confirm the required vendored openRepoTools pin update is included before merge.

Sequence diagram for Claude launch lane-mode propagation

sequenceDiagram
    participant User
    participant Launcher as claude-profile
    participant Tmux
    participant Claude
    participant Hook

    User->>Launcher: pclaude <profile>
    Launcher->>Launcher: export CLAUDE_NO_LANE=1
    Launcher->>Claude: exec Claude without lane
    Claude->>Hook: start with CLAUDE_NO_LANE=1
    Hook-->>Claude: skip lane guard

    User->>Launcher: lclaude <profile>
    Launcher->>Launcher: unset CLAUDE_NO_LANE
    Launcher->>Tmux: launch lane child
    Tmux->>Claude: invoke Claude with lane mode
    Claude->>Hook: start without no-lane marker
    Hook-->>Claude: enforce lane guard

    alt explicit --no-lane
        User->>Launcher: --no-lane with profile options
        Launcher->>Launcher: export CLAUDE_NO_LANE=1
        Launcher->>Claude: exec Claude without lane
    end

    alt refused lane handoff
        Launcher->>Claude: bare fallback with CLAUDE_NO_LANE=1
    end
Loading

File-Level Changes

Change Details Files
Normalize and propagate the selected lane mode through launcher execution.
  • Export CLAUDE_NO_LANE=1 for direct profile launches, tmux children, and bare fallbacks.
  • Track explicit lane and no-lane options so lane requests clear inherited markers while --no-lane wins in either order.
  • Unset the marker before lane handoff and preserve the existing shared profile hooks.
base-image/files/claude-profile
Add regression coverage for mode propagation, precedence, and fallback behavior.
  • Observe the marker in fake Claude and lane-start processes.
  • Cover inherited markers, explicit lane requests, both option orders, tmux re-execution, and refused-lane fallback.
  • Retain binary-selection and launcher compatibility checks.
devcontainer.test/test-claude-profile-binary-selection.sh
devcontainer.test/test-claude-profile-lane-default.sh
Document the launch-mode environment contract and user-facing behavior.
  • Clarify that profile-only launches export the no-lane marker and lane launches clear it.
  • Document explicit option precedence and the requirement to relaunch sessions when changing mode.
  • Explain that shared hooks remain installed while the prompt guard uses the process marker.
README.md
docs/claude-multi-account-profiles.md
Add governance and implementation specifications for publishing launch mode.
  • Define requirements and scenarios for direct, tmux, inherited, explicit, and fallback modes.
  • Record the implementation plan, task completion, dependency on the matching openRepoTools guard, and verification results.
openspec/changes/export-no-lane-mode/.openspec.yaml
openspec/changes/export-no-lane-mode/design.md
openspec/changes/export-no-lane-mode/proposal.md
openspec/changes/export-no-lane-mode/specs/claude-launch-lane-mode/spec.md
openspec/changes/export-no-lane-mode/tasks.md
specs/017-export-no-lane-mode/plan.md
specs/017-export-no-lane-mode/spec.md
specs/017-export-no-lane-mode/tasks.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@brettheap

Copy link
Copy Markdown
Contributor Author

@codex review

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

The required vendored guard dependency and active feature pointers are not updated, and several new regression cases can pass using stale logs.

Review effort: Balanced
Findings: 1 High severity · 3 Medium severity

Open (4)
What changed in this PR

Publishes Claude’s actual lane mode to hooks while preserving explicit option precedence and tmux behavior.

Changes:

  • Exports or clears CLAUDE_NO_LANE based on resolved launch mode.
  • Extends launcher regression coverage.
  • Documents the launch-mode contract and governance.
File Description
base-image/​files/​claude-profile Normalizes and propagates lane mode.
devcontainer.test/​test-claude-profile-binary-selection.sh Tests mode propagation and fallback.
devcontainer.test/​test-claude-profile-lane-default.sh Updates inherited-mode expectations.
README.md Documents profile-only launches.
docs/​claude-multi-account-profiles.md Expands environment contract guidance.
specs/​017-export-no-lane-mode/​spec.md Defines requirements and scenarios.
specs/​017-export-no-lane-mode/​plan.md Records implementation approach.
specs/​017-export-no-lane-mode/​tasks.md Tracks implementation and verification.
openspec/​changes/​export-no-lane-mode/​.openspec.yaml Configures the OpenSpec change.
openspec/​changes/​export-no-lane-mode/​proposal.md Explains motivation and impact.
openspec/​changes/​export-no-lane-mode/​design.md Records design decisions.
openspec/​changes/​export-no-lane-mode/​tasks.md Records governance handoff.
openspec/​changes/​export-no-lane-mode/​specs/​claude-launch-lane-mode/​spec.md Specifies launch-mode behavior.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread specs/017-export-no-lane-mode/tasks.md
Comment thread devcontainer.test/test-claude-profile-binary-selection.sh
Comment thread devcontainer.test/test-claude-profile-binary-selection.sh
Comment thread specs/017-export-no-lane-mode/spec.md

@chatgpt-codex-connector chatgpt-codex-connector Bot 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: cb116077b7

ℹ️ 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 thread base-image/files/claude-profile
Copilot AI balanced review requested due to automatic review settings September 30, 2026 18:13
@brettheap

Copy link
Copy Markdown
Contributor Author

@codex review

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

The required marker-aware openRepoTools dependency has not yet been merged and vendored, so the documented guard bypass is not operational.

Review effort: Balanced
Findings: 2 High severity

Open (2)
Resolved since last review (3)

Comment thread README.md
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: fab369f464

ℹ️ 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".

Copilot AI balanced review requested due to automatic review settings September 30, 2026 18:39
@brettheap
brettheap marked this pull request as ready for review September 30, 2026 18:40
@brettheap

Copy link
Copy Markdown
Contributor Author

@codex review

@sourcery-ai sourcery-ai Bot 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.

Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 1 day and 19 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Copilot AI 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.

Copilot review overview

🔵 Needs a closer look

Two new regression cases can pass using stale output without proving Claude was launched.

Review effort: Balanced
Findings: None

Resolved since last review (2)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Clear stale logs and verify Claude launches in profile-only case

devcontainer.test/​test-claude-profile-binary-selection.sh:107

This profile-only case reuses launch.log, mode.log, and identity.log from the immediately preceding direct launch. If pclaude incorrectly exits without starting Claude, all three current assertions still pass from stale output. Clear those logs before this invocation and assert the selected Claude executable was launched, as the later refusal case does.

This issue also appears on line 143 of the same file.

Copilot AI balanced review requested due to automatic review settings September 30, 2026 18:46
@brettheap

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Copilot AI 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.

Copilot review overview

🟢 Approval recommended

The launch-mode contract, vendored dependency, documentation, and registered regression coverage are consistent with no unresolved issues found.

Review effort: Balanced
Findings: None

@brettheap
brettheap merged commit 206de19 into main Sep 30, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants