Fixes from ralph-tmux-codex-test exploratory campaign - #231
Conversation
Skip `git fetch origin` when the repo has no `origin` remote, and trust the resolved base branch from `findBaseBranch` instead of synthesising an `origin/` prefix that can't be checked out on local-only repos. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… fallback Thread a `freshWorktree` flag from `createFeature` / `recreateImplementWorktree` call sites through `attachSession` and `launchSessionBackground` into the launch helpers. When set, launch claude / codex / gemini without their resume flag — there is no prior session in a directory we just created, and `codex resume --last` would print a noisy "No saved session found" on first launch. When false, trust that a prior session exists in the existing worktree and use the resume form directly (no fallback chain). Closes ralph-tmux-codex-test findings #2 (plain attach broken on fresh codex worktrees) and #3 (noisy resume error on first prompted launch). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
When GitService creates a worktree and the requested name collides with an existing branch, it suffixes (foo → foo-2) but the tracker slug, item directory, and tmux session name silently drift to the original. Add `TrackerService.renameItem` that moves the slug across all index buckets, migrates the sessions metadata key, renames the on-disk item dir, and rewrites the `slug:` frontmatter. App's `ensureItemWorktree` detects the mismatch from `recreateImplementWorktree` and adopts the suffixed name as the canonical slug so everything stays in lockstep. Closes ralph-tmux-codex-test finding #8. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ux-codex-fixes Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Code Review: PR #231 — Fixes from ralph-tmux-codex-testOverall: Well-scoped bug-fix bundle with clear intent and good test coverage. A few issues worth addressing before merge. fix(git): GitService.createWorktree (#1)Good:
Concern — fragile string matching in const out = runCommandQuick(['git', '-C', repoPath, 'remote', 'get-url', 'origin']);
return !!out && !/fatal/i.test(out);This relies on the English text fix(sessions): freshWorktree flag (#2)Good:
Gap — In if (needsSelection) {
showAIToolSelection(created); // ← freshWorktree not passed
} else {
await attachSession(created, undefined, undefined, {freshWorktree: true});
}And in if (needsSelection) {
showAIToolSelection(prepared.worktree, {initialPrompt: prepared.prompt, ...}); // ← freshWorktree not passed
} else {
await attachSession(..., {freshWorktree: prepared.fresh});
}When a brand-new worktree requires tool selection, the session launched after the user picks a tool will still run Behavior change for existing worktrees: fix(tracker): TrackerService.renameItem (#8)Good:
Concern — unescaped slug in regex: const slugLineRe = new RegExp(`^slug:\\s*${oldSlug}\\s*$`, 'm');
Minor — if (created.feature !== item.slug) {
const renamed = tracker.renameItem(...);
if (renamed) activeItem = {...item, slug: created.feature};
}The guard Tracker files in source treeThe PR adds Tests
Missing: There's no test for the case where Summary
🤖 Generated with Claude Code |
- Thread `freshWorktree` through the AI tool selection path. When a brand-new worktree needs tool selection, the subsequent attach now correctly skips `claude --continue` / `codex resume --last`, which was the original bug that fix(sessions) targets. - Document that slug interpolation in `rewriteSlugFrontmatter` is regex-safe because `isValidSlug` constrains slugs to `[a-z0-9-]`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Code Review: PR #231 — Fixes from ralph-tmux-codex-test exploratory campaignOverview: Three focused bug fixes covering local-only repo worktree creation, fresh-session launch noise, and tracker slug drift. The PR description is thorough, the scope is tight, and the test plan was followed. 757 tests passing is a good baseline signal. Fix 1 —
|
| Area | Assessment |
|---|---|
| Code correctness | ✅ Fixes are correct for the stated bugs |
| Conventions | ✅ Follows project patterns (service layer, ESM imports, TypeScript strict) |
| Test coverage | ✅ Good unit coverage; E2E gap noted above |
| Security | ✅ No new attack surface; shellQuote used on prompt args |
| Performance | ✅ Conditional fetch avoids unnecessary network call |
| Risk | renameItem atomicity gap — both low-probability, documented above |
Overall this is a clean, well-scoped set of fixes. Address the atomicity gap and the silent-failure path in ensureItemWorktree before merging, and the PR is in good shape.
Code Review — PR #231: Fixes from ralph-tmux-codex-test exploratory campaignOverviewThree targeted bug fixes covering: (1) worktree creation on local-only repos without an Fix 1 —
|
Code Review — PR #231: Fixes from ralph-tmux-codex-test exploratory campaignOverviewThree targeted fixes closing 4 of 9 confirmed bugs. The PR description is unusually transparent about what's still open and why — that's a model to keep. Fix 1 —
|
Summary
Three fixes that close 4 of the 9 confirmed bugs from
ralph-tmux-codex-test's exploratory tmux+Codex run:fix(git)—GitService.createWorktreenow works on a brand-new local-only repo with nooriginremote. Skipsgit fetch originwhen no origin exists; passes the resolved base branch through unchanged instead of synthesising a non-existentorigin/<base>ref. (Closes finding Rename CleanDiffView to DiffView #1.)fix(sessions)— Threads anopts.freshWorktreeflag fromcreateFeature/recreateImplementWorktreethroughattachSession/launchSessionBackgroundinto the launch helpers. When set, codex/claude/gemini launch fresh (noresume --last/--continue) so first-launch into a just-created worktree never tries to resume a session that doesn't exist. (Closes findings Fix slow navigation after archiving/creating branches #2 + Add auto-attach functionality for new feature branches #3.)fix(tracker)— AddsTrackerService.renameItemand wires it intoApp.ensureItemWorktreeso when a worktree-create lands on a suffixed name (foo-2because branchfooalready exists), the tracker slug,tracker/index.jsonbuckets,sessionskey, on-disktracker/items/directory, andslug:frontmatter all adopt the suffix in lockstep — no silent drift between tracker, worktree, and tmux session names. (Closes finding Restore execute session feature (x/X shortcuts) #8.)The original 5th fix (codex pane-state detector for trust / sandbox-retry / usage-limit / model-switch modals) was dropped during rebase: PR #228 (
33c4a71 terminal ui state detection) landed inmainwhile this branch was open and reorganisedgetStatusForToolaround picker-based detection. My substring regex against the modal text reproduced as a false-positive on the existing fixtures (those modals stay in scrollback after dismissal), and the picker-based shape from #228 is the right primitive.Findings #4, #5, #7 are partially open after this PR — main's picker patterns catch active codex consent/permission dialogs, but trust-prompt-only (
Press enter to continue) and usage-limit/model-switch modals aren't matched today. Recommended follow-up: capture proper fixtures for those active states and extend the picker patterns. Findings #6 and #9 stay out of scope per requirements (agent-sidestatus.jsonwrite race; PTY-harness keystroke flakiness).Test plan
npx tsc -p tsconfig.test.json --noEmit— cleannpx tsc -p . --noEmit— cleannpm test— 757 tests pass across 76 suitesnpm run build— clean🤖 Generated with Claude Code