Skip to content

Use lclaude for lane restarts - #129

Merged
brettheap merged 4 commits into
mainfrom
lclaude-restarts
Sep 23, 2026
Merged

brettheap merged 4 commits into
mainfrom
lclaude-restarts

Conversation

@brettheap

@brettheap brettheap commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Prefer lclaude for lane launches, handoff restarts, and direct pane respawns.
  • Use explicit pclaude --lane when lclaude is not installed, so mixed versions never restart a lane through bare profile-only pclaude.
  • Cover the new command in lane helper regressions.

Lane: workBenches-lclaude-1
Claim: #128 (comment)
Closes #128

Summary by Sourcery

Use lane-aware lclaude commands for launches and restarts while retaining explicit pclaude --lane compatibility for installations without lclaude.

New Features:

  • Prefer lclaude for lane launches, handoff restarts, and direct pane respawns, with explicit lane-aware pclaude fallback support.

Bug Fixes:

  • Prevent lane restarts on mixed-version installations from resolving through profile-only pclaude commands.

Enhancements:

  • Update lane handoff guidance to describe the new restart command selection and supported entry points.

Documentation:

  • Update lane documentation and handoff instructions for lclaude-based restarts and the pclaude --lane fallback.

Tests:

  • Extend lane helper regressions to verify lclaude is selected when available for handoffs and pane respawns.

Lane: workBenches-lclaude-1
Copilot AI lite review requested due to automatic review settings September 23, 2026 17:01
@sourcery-ai

sourcery-ai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The PR routes lane launches and restart paths through lclaude when installed, while retaining a lane-explicit pclaude --lane fallback for mixed-version environments. Regression coverage simulates the launcher and verifies both user-facing restart guidance and direct tmux pane respawn commands.

File-Level Changes

Change Details Files
Prefer the lane-aware launcher for lane startup, handoff restarts, and direct pane respawns, with an explicit fallback for environments without it.
  • Select lclaude when available for lane-aware launches and restarts.
  • Fall back to pclaude --lane <lane> rather than bare profile-only pclaude to preserve lane targeting across mixed installations.
  • Update restart output and respawn commands to reflect the selected launcher.
lane
lane-handoff
Extend helper regressions to verify lclaude selection and lane argument placement.
  • Add a fake lclaude executable to simulate its presence and capture invocations.
  • Assert handoff output uses lclaude for installed-launcher cases.
  • Assert direct respawn uses lclaude --lane <lane> <profile> when lane is unavailable on PATH.
tests/test_lane_helpers.sh

Assessment against linked issues

Issue Objective Addressed Explanation
#128 Update lane launches, lane-picker behavior, handoff restarts, and direct pane respawns to use the lane-aware lclaude launcher. ✅
#128 Retain rollout compatibility by falling back to explicit pclaude --lane <lane> <profile> when lclaude is unavailable, avoiding bare profile-only pclaude restarts. ✅
#128 Add regression coverage confirming the new lclaude command and lane-aware restart behavior. ✅

Possibly linked issues


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

sourcery-ai[bot]
sourcery-ai Bot previously approved these changes Sep 23, 2026

@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.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

sourcery-ai[bot]
sourcery-ai Bot previously approved these changes Sep 23, 2026

@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.

Sourcery assessment

Approved.

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

Unresolved launcher resolution, documentation, recovery-command, and test-isolation issues remain.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Medium severity · 2 Low severity

Open (4)
What changed in this PR

Updates lane launches and restarts to prefer lclaude, with pclaude --lane fallback compatibility.

Changes:

  • Updated lane and handoff launcher selection.
  • Added restart and respawn regression coverage.
  • Added fallback behavior for environments without lclaude.
File Description
tests/​test_lane_helpers.sh Tests launcher selection, fallback behavior, and restart handling.
lane-handoff Uses lane-aware launchers for handoffs and direct respawns.
lane Prefers lclaude for lane launches.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lane
local lp="${PCLAUDE:-}"
if [ -z "$lp" ]; then
lp="$(command -v pclaude 2>/dev/null || command -v claude-profile 2>/dev/null || printf '')"
lp="$(command -v lclaude 2>/dev/null || command -v pclaude 2>/dev/null || command -v claude-profile 2>/dev/null || printf '')"
Comment thread lane-handoff
Comment on lines +921 to +922
lane_profile_word="pclaude --lane $lane"
command -v lclaude >/dev/null 2>&1 && lane_profile_word=lclaude
Comment thread lane
Comment on lines +565 to +567
lp="$(command -v lclaude 2>/dev/null || command -v pclaude 2>/dev/null || command -v claude-profile 2>/dev/null || printf '')"
fi
[ -n "$lp" ] || die "there is no launcher on PATH (neither \`pclaude\` nor \`claude-profile\`), and this
[ -n "$lp" ] || die "there is no launcher on PATH (neither \`lclaude\`, \`pclaude\`, nor \`claude-profile\`), and this
Comment thread lane-handoff
Comment on lines 1160 to 1168
launcher="${PCLAUDE:-}"
if [ -z "$launcher" ]; then
launcher="$(command -v pclaude 2>/dev/null || command -v claude-profile 2>/dev/null || printf '')"
launcher="$(command -v lclaude 2>/dev/null || command -v pclaude 2>/dev/null || command -v claude-profile 2>/dev/null || printf '')"
fi
[ -n "$launcher" ] ||
die "the record is written and there is neither \`lane\` nor a launcher on PATH (pclaude, claude-profile), so this pane was NOT respawned. Start the lane yourself: $restart_cmd" 2
die "the record is written and there is neither \`lane\` nor a launcher on PATH (lclaude, pclaude, claude-profile), so this pane was NOT respawned. Start the lane yourself: $restart_cmd" 2
[ -n "$profile_name" ] ||
die "the record is written and this lane's record names no profile, so the launcher cannot be told which account to come up in and the pane was NOT respawned. Start it yourself, naming the profile: pclaude --lane $lane <profile>" 2
die "the record is written and this lane's record names no profile, so the launcher cannot be told which account to come up in and the pane was NOT respawned. Start it yourself, naming the profile: $restart_cmd" 2
launch_line="LANE_START_FRESH=1 $(quoted "$launcher" --lane "$lane" "$profile_name")"
Copilot AI review requested due to automatic review settings September 23, 2026 17:05
@brettheap

Copy link
Copy Markdown
Contributor Author

@codex review

sourcery-ai[bot]
sourcery-ai Bot previously approved these changes Sep 23, 2026

@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.

Sourcery assessment

Approved.

@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

🔵 Needs a closer look

Resolve launcher-selection test coverage, PCLAUDE override hints, and stale documentation.

Review effort: Lite
Findings: 2 Medium severity · 2 Low severity

Open (4)

@sonarqubecloud

Copy link
Copy Markdown

@brettheap
brettheap merged commit 4218e6d into main Sep 23, 2026
4 of 6 checks passed
Copilot AI review requested due to automatic review settings September 23, 2026 17:09

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

Resolve launcher-selection inconsistencies, update stale guidance, and add missing picker coverage.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Medium severity · 3 Low severity

Open (5)
Previously missed (1)

In code that hasn't changed since last review

Low severity Update late-handoff guidance to use lclaude

lane-handoff:110

This header now advertises lclaude as the default, but the late-handoff instructions immediately above still tell operators to run bare pclaude <profile>. That is inconsistent with the implementation and can send a mixed-version installation through profile-only pclaude; update the late-handoff guidance to use lclaude and the explicit pclaude --lane fallback.

Comment thread docs/README-lanes.md
```sh
lane-handoff --late --at 2026-09-14T12:02:27Z "late; usage limit hit before the swap"
pclaude <profile> # and only then
lclaude <profile> # and only then; use pclaude --lane <lane> if lclaude is unavailable

@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: 624525d67e

ℹ️ 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 lane-handoff
Comment on lines +921 to +922
lane_profile_word="pclaude --lane $lane"
command -v lclaude >/dev/null 2>&1 && lane_profile_word=lclaude

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Honor PCLAUDE when selecting the restart command

When PCLAUDE explicitly selects pclaude or another launcher while lclaude also exists on PATH, this unconditional probe makes the printed plain/late handoff command use lclaude instead. The automatic --restart path still honors PCLAUDE at line 1160, so the READY message and failure remedies can name a different launcher from the one actually configured and executed; derive this choice from PCLAUDE before probing PATH.

Useful? React with 👍 / 👎.

Comment thread docs/README-lanes.md
```sh
lane-handoff --late --at 2026-09-14T12:02:27Z "late; usage limit hit before the swap"
pclaude <profile> # and only then
lclaude <profile> # and only then; use pclaude --lane <lane> if lclaude is unavailable

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Include the profile in the pclaude fallback

On the older installations for which lclaude is unavailable, the suggested fallback omits the required profile argument. The implementation itself constructs pclaude --lane <lane> <profile>; following this canonical lane manual literally therefore cannot select the intended account. Spell the fallback as pclaude --lane <lane> <profile>.

AGENTS.md reference: AGENTS.md:L20-L22

Useful? React with 👍 / 👎.

brettheap added a commit that referenced this pull request Oct 3, 2026
Bring in #81 (lane-rename and the lane alias table), #129, #131, #133,
#135 and #136 so the PR is mergeable again. Two textual conflicts, both
resolved so each side's intent survives:

- lanes-edit.sh, the `*)` arm's unknown-subcommand list: main added
  `rename-lane`, this branch added `duplicate-holder`. The list now
  carries both, which is what test_repo_hygiene's derived-list check
  demands of the dispatcher.
- tests/test_lane_helpers.sh, the suite's fakebin: main added a fake
  `gh` (Copilot round 7 on #81), this branch added fake `pgrep` and
  `ps` (issue #39). All three fakes are kept and the one chmod line
  marks all five fakebin entries executable.

No new main code calls pgrep or ps, so the suite-wide fakes change
nothing for main's new cases; and main's file-keyed LOG_AWK lane field
leaves holder_is_dead's verb-only read and superseded_by's tolower
comparison unchanged in meaning.

Lane: openRepoTools-3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
brettheap added a commit that referenced this pull request Oct 3, 2026
…#131 #133 #135 #136): one cap conflict, settled at the count of what merged

One textual conflict, the AGENTS.md line cap in
tests/test_repo_hygiene.py: this branch raised 265 to 278 for Amendment
18's ONE BINDING rule, and #119 raised the same 265 to 292 for the
cycle's three rulings. AGENTS.md itself auto-merged to 305 lines,
265 + 13 + 27, with both paragraphs whole and #135's profile-only guard
sentence beside them. So the cap is 305, with a dated MEET AT entry in
the form the 224 entry's rule asks for, rather than either side's
number.

Everything else auto-merged and was read for meaning, not just for
markers. #135 hoists the global-flag parse in lanes-edit.sh above the
path probes and exits 0 for `guard` under exact CLAUDE_NO_LANE=1; this
branch's guard clauses (d) and (e) sit inside the guard, after that
exit, which is right because a profile-only session holds no binding.
Every positional read between the new and old parse sites is inside a
function. #129's lclaude-first launcher in `lane` is the one this
branch's elsewhere and available paths already call. #133's
stable_lane_row and #129's lclaude fakes are cases of their own and
touch none of this branch's.

Lane: openRepoTools-3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brettheap
brettheap deleted the lclaude-restarts branch October 3, 2026 18:49
brettheap added a commit that referenced this pull request Oct 4, 2026
Bring #97 onto a current base before the seam rework Brett Heap ruled on
2026-10-04 ("managed ledger owns enrolled lanes; #97 owns legacy — rework
both"). Main moved 14 commits past 957a26f, to daed209: #81 lane-rename,
#83 Amendment 18, #93 Amendment 19, #61 claim --force takeover, #146,
#119, #101-#103, #129, #131, #133, #135, #136, #139 and #134.

Four files conflicted, and in every one both intents survive:

- lanes-edit.sh, the function sections: both sides appended after
  migrate_state_cells. Main's Amendment 19(c)/(d) sweep and archive stay
  directly under it, because its header says "the shape
  `migrate-state-cells` has one screen up"; #97's lifecycle and
  inventory section follows them.
- lanes-edit.sh, the unknown-subcommand refusal: the union of both lists,
  56 names, the same set as the dispatcher's 56 arms.
- lanes-edit.sh, the exit-code table, and the manual's copy of it: #97's
  7 row ("another act got there first", in three verbs) is kept, and exit
  9 now has two meanings, one per verb. #61 spent 9 on `claim --force`'s
  abandoned takeover and #97 spent it on `lane-state`'s unreadable
  snapshot, and each PR took it as unused. Neither verb can return the
  other's 9, so the table names both and nothing is renumbered in a
  merge. The manual's 9 row said "(`claim` only)", which the merge would
  have made false; its 7 row now names #97's two fenced writers too, as
  the code table already did. The next commit moves #97's 9 to 10.
- lane-handoff, the late-record restart line: #129's
  `$lane_profile_word` (lclaude) with #97's lifecycle line under it.
- docs/README-lanes.md: Amendment 19's section, then #97's #91 section,
  so the amendment sections stay in number order.
- tests/test_lane_helpers.sh: main's Amendment 19 and Amendment 18
  sections run first, in main's order (A18's restores its fixtures), and
  #97's self-contained #91 section follows them, before the
  workstation-seam section, as it did on #97's branch.

lane-start auto-merged around #134's rewrite. #97's section 4a still
prints the reconciliation after Amendment 18's binding gate and before
section 5 and the STARTED/RESUMED write in 5b. AGENTS.md, README.md,
tests/test_repo_hygiene.py and skills/ are byte-identical to main, so
the 316- and 486-line caps already match the merged counts.

Locally, tests/run.sh -k 'lane_helpers_suite or repo_hygiene or
lane_start_claude_current or guard_launch_mode or install_skill_and_hook':
274 passed, 600 deselected, in 1560 s.

Lane: openRepoTools-3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Route Claude lane restarts through lclaude

2 participants