Repository navigation
fix: release Codex locks and improve GitHub diagnostics - #1109
Closed
KarlvonPoncet wants to merge 8 commits into
Closed
KarlvonPoncet wants to merge 8 commits into
KarlvonPoncet wants to merge 8 commits into
Conversation
KarlvonPoncet
force-pushed
the
fm/fix-codex-lock-gh-diagnostics-20260727
branch
from
July 28, 2026 06:59
9fb3b36 to
9f2928a
Compare
Owner
|
Automated reminder: thanks for the PR! This branch currently has a merge conflict with the base branch. When you get a chance, please rebase onto (or merge) the latest base branch, resolve the conflict, and push. After that, checks will re-run and the PR will get looked at again. Noted for firstmate#1109 at |
Owner
|
Automated reminder: this PR still looks blocked on a rebase or merge conflict fix. If you are still interested, please rebase onto the current base branch, resolve the conflict, and push. If I do not hear back, I may close this as inactive. |
Owner
|
Speaking as Kun's firstmate: closing this as stale. It has been waiting on a contributor update for 14+ days with no author push or comment. Reopen if you want to pick it back up. |
|
/qa-gate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Ship two related Firstmate reliability fixes based on reproduced end-user failures. Make clean Codex /quit release the per-home session lock through supported native lifecycle integration while preserving fail-closed exclusion of live sessions, same-thread behavior, verified stale recovery, and PID-isolated compatibility. Distinguish genuine GitHub authentication failure from API network or DNS failure, inaccessible credential storage, and combined sandbox isolation without leaking credentials or requiring live GitHub in tests. Update authoritative headers and help plus narrowly relevant docs under the one-owner rule, keep scripts shellcheck-clean, and validate with focused real and deterministic regressions. Include the approved follow-up decisions: structured GitHub CLI state=timeout maps to GH_NETWORK with regression coverage, GROK_AGENT takes precedence over inherited CODEX_THREAD_ID with regression coverage, and publication uses the KarlvonPoncet/firstmate fork while the PR targets kunchenguid/firstmate.
What Changed
GROK_AGENTand an inherited Codex thread marker coexist, with focused deterministic and live regressions plus updated operator documentation.Risk Assessment
✅ Low: The follow-up now enforces Grok-over-Codex marker precedence at the shared session-lock owner boundary with deterministic regression coverage, and the complete branch remains well-bounded with no other substantiated source or intent-conformance defects.
Testing
No baseline commands were supplied; focused lock, bootstrap, and session-start regressions passed, and a real Codex CLI 0.145.0 PTY session confirmed that clean /quit fires SessionEnd and removes the per-home lock. The first live attempt was blocked by the runner's unsupported TERM=dumb setting, then passed unchanged with TERM=xterm-256color. CLI logs were captured instead of screenshots because the changed user surfaces are terminal lifecycle and diagnostic output, not rendered UI.
Evidence: Real Codex /quit lifecycle evidence
ok - codex-cli 0.145.0 live /quit fired SessionEnd and released the per-home lockEvidence: Codex lock regression evidence
Covers matching release, same-thread preservation, stale recovery, live-session exclusion, PID-isolated fail-closed behavior, and malformed/symlinked lock preservation.Evidence: GitHub diagnostic regression evidence
Covers deterministic missing/invalid auth, network/DNS, structured timeout, inaccessible credential storage, combined sandbox isolation, and inspection failure without live GitHub.Evidence: Session-start regression evidence
Includes PID-isolated Codex ownership and GROK_AGENT precedence over inherited CODEX_THREAD_ID.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed ✅
bin/fm-session-lock-lib.sh:49- Intent requires "GROK_AGENT takes precedence over inherited CODEX_THREAD_ID", butfm_session_lock_ownerstill treats any non-emptyCODEX_THREAD_IDas Codex without checkingGROK_AGENT. A Grok session inheriting a Codex marker is correctly identified as Grok byfm-harness.sh, thenfm-lock.shwrites a Codex owner anyway; same-session checks subsequently trust the inherited Codex thread and Grok has no Codex SessionEnd release. Enforce the precedence at the shared lock-owner boundary, not only in harness-name detection, and cover the resulting owner record in the Grok regression.🔧 Fix: Honor Grok precedence in session lock ownership
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-codex-session-lock.test.shbash tests/fm-bootstrap.test.shbash tests/fm-session-start.test.shTERM=xterm-256color FM_CODEX_LOCK_LIVE_E2E=1 bash tests/fm-codex-session-lock-live-e2e.test.shgit remote -vverified upstream fetch and fork push destinationsgit status --shortverified testing left no working-tree artifacts✅ **Document** - passed
✅ No issues found.
🔧 Fix: Validate lint with pinned ShellCheck 0.11.0
1 warning still open:
✅ **Push** - passed
✅ No issues found.