GeezerVison is showing github.com — fix(cli): preserve live server ownership after project probe failures by maria-rcks · Pull Request #15624 · pingdotgg/t3code
Conversation
maria-rcks
commented
Oct 4, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
failed one-second t3 project add, rename, and remove probes could delete server-runtime.json and write offline behind a running server. failed probes now retain that record and report the recorded pid/origin with retry or stop guidance while its process is alive. only an exited owner permits stale-record cleanup and offline fallback, including when a living owner's listener refuses connections.
blacksmith passed: 34 focused project-cli/runtime-state tests, scoped lint, server typecheck, and formatting. all 12 added regressions failed on baseline (add/rename/remove across timeout, 401, 503, and connection refusal); the exited-owner control passed. tests exercise the real cli and persistence with an injected http transport, using the existing test file and fixture.
a recycled pid is conservatively treated as possible ownership: verify that the recorded server has stopped before manually removing a confirmed stale runtime record. the descriptor does not retain an os process-start identity, so automatic recycled-pid recovery remains outside this focused safety fix.
actual paused-server reproduction, retry visibility in clients, and windows behavior remain unverified and are coordinated by the parent. broader server ownership locking remains separate in #14694.
Closes #7504
model: gpt-6.1-sol (xhigh). harness: codex through t3 code.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Oct 4, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
41cf1c2b-e386-46ff-8b6e-2b3518e51a66
📥 Commits
Reviewing files that changed from the base of the PR and between 17c0878 and 8ab1305.
📒 Files selected for processing (2)
apps/server/src/cli/project.test.ts
apps/server/src/cli/project.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
📝 Walkthrough
Walkthrough
The project CLI now checks whether the process recorded in server runtime state is alive after a live-server request fails. It reports an error and preserves state if the process is running. If the process has exited, it clears stale state and continues offline.
Changes
Project CLI server probe
| Layer / File(s) |
Summary |
Live-server failure resolution apps/server/src/cli/project.ts |
The CLI adds ProjectLiveServerUnavailableError and checks the recorded process after a failed request. It preserves runtime state and does not fall back offline if the process is alive. If the process has exited, the existing cleanup and offline path continue. |
Probe failure tests apps/server/src/cli/project.test.ts |
Tests cover add, rename, and remove when probes time out, return 401 or 503, or refuse connections. They also verify that a dead recorded process allows an offline rename and stale-state cleanup. |
Priority: ➖ Normal
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers: juliusmarminge
Merge Risk: ⚪ Minimal · up to 8ab13
The CLI now avoids offline project changes when the recorded server process is still running and gives actionable guidance. No merge-blocking issue is established.
Security Architecture Review
Security architecture risk: 🔵 Low · up to 8ab13
The change makes project commands fail closed when the recorded server process remains alive, reducing the chance of offline writes behind a running server. No introduced authentication bypass was found. Process identity and concurrent restart behavior remain limitations of the existing ownership mechanism.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
- inferred — The changed exposure is confined to project CLI commands, their configured project persistence, and the recorded server. The diff introduces no remote entrypoint or additional mutation authority; it removes offline mutation reachability after a failed probe while the recorded process is alive.
Trust Boundaries and Controls
- observed — Live snapshot and mutation requests continue to use a temporary authenticated CLI session with administrative scopes and subsequent revocation. The new failure branch neither changes bearer-token handling nor bypasses it through offline dispatch when the recorded PID is alive.
Resilience and Maintainability Implications
- inferred — Existing ownership recovery remains non-atomic: CLI cleanup can remove a replacement runtime record after checking an old dead PID, and an old server shutdown can remove a replacement record. Atomic record writes do not synchronize those removals. This limitation predates the PR; the new live-PID guard narrows cleanup reachability rather than establishing exclusive ownership. PID reuse can now conservatively block fallback, and concurrent lifecycle behavior has not been reproduced.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
| Check name |
Status |
Explanation |
| Title check |
✅ Passed |
The title clearly summarizes the main change: preserving live-server ownership after project probe failures. |
| Description check |
✅ Passed |
The description covers the problem, change, linked issue, verification results, and known limitations. It does not explicitly state maintainer approval or explain why the fix qualifies as an obvious b… |
| Linked Issues check |
✅ Passed |
#7504 requires failed t3 project add, rename, and remove probes not to delete server-runtime.json or fall back offline while the recorded server may still own the database. `tryResolveLiveProj… |
| Out of Scope Changes check |
✅ Passed |
The reported production change is limited to failed live-server resolution for the project CLI. The related tests exercise the same behavior and the offline fallback control. No unrelated changes are … |
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
macroscopeapp
Bot
commented
Oct 4, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Approvability
Verdict: Approved at 8ab1305
Macroscope's review found this PR approvable — This focused CLI bug fix preserves the live server record and blocks unsafe offline mutations only when the recorded process is still alive, while retaining stale-state cleanup for exited processes. The production change is small and is covered by targeted tests for the relevant probe failures and fallback path.
Notes:
- All code in this push has already been reviewed. Approvability was decided on eligibility alone.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Note Written by claude-opus-5-5 on behalf of Maria
Superseded by #16102: offline t3 project commands there take the same state-directory lock as the server, and a failed live probe no longer clears server-runtime.json, which fixes #7504 without a separate PID check here.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:S
10-29 changed lines (additions + deletions).
vouch:trusted
Author is trusted by repo permissions or the VOUCHED list.
Milestone
No milestone
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.
|