Repository navigation
refactor(session): model startup lifecycle states - #952
Merged
benvinegar merged 2 commits intoSep 1, 2026
Merged
benvinegar merged 2 commits into
benvinegar merged 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This was referenced Aug 31, 2026
benvinegar
marked this pull request as ready for review
August 31, 2026 19:29
Contributor
Greptile SummaryThis PR replaces separate startup promise, retry timer, and stopped fields with an explicit broker-client lifecycle state machine.
Confidence Score: 4/5The PR appears safe to merge, with only a non-blocking type-safety issue in the new tests. The lifecycle transitions preserve retry ownership, callback fencing, and terminal stop behavior; the remaining concern is that four test overrides bypass compile-time contract checking through explicit any casts. Files Needing Attention: src/session/broker/brokerClient.test.ts Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
Idle[idle] -->|start| Attempting[attempting]
Attempting -->|success| Idle
Attempting -->|failure: create retry| AttemptingRetry[attempting-with-retry]
Waiting[waiting] -->|manual start: retain retry| AttemptingRetry
AttemptingRetry -->|attempt settles| Waiting
Waiting -->|retry deadline| Idle
AttemptingRetry -->|retry deadline: consume retry| Attempting
Idle -->|stop| Stopped[stopped]
Attempting -->|stop| Stopped
AttemptingRetry -->|stop and clear retry| Stopped
Waiting -->|stop and clear retry| Stopped
Prompt To Fix All With AI### Issue 1
src/session/broker/brokerClient.test.ts:774
**Lifecycle mocks bypass type checking**
The four new lifecycle tests replace `ensureDaemonAndConnect` through `(client as any)`, so method renames or signature changes can leave these mocks compiling against a stale contract. Use a typed test seam or narrowly typed override to preserve compile-time checking; the same pattern occurs at lines 816, 855, and 889.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "refactor(session): model startup lifecyc..." | Re-trigger Greptile |
benvinegar
force-pushed
the
refactor/session-startup-states
branch
from
August 31, 2026 19:49
c230c81 to
801eda5
Compare
1 task
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.
Summary
Stack
Base branch:
fix/session-socket-start-rollback. Review only the third commit for this PR.Validation
bun run typecheckbun run lintbun run deps:checkThe repository test wrapper is locally blocked because the installed
node_modules/bunpackage lacks its postinstall artifact; equivalent system-Bun test invocations passed.Non-goals
This PR description was generated by Pi using gpt-5.6-sol