Follow-ups from the #1023 process-owner reviews: usage emit order, detach checkpoint, stall guard, Ref state
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
Direzione di ricerca
Start with the two prioritized failure windows in packages/agents/src/harness/claude/claude.ts (resume) and packages/agents/src/child-host/process.ts (the lifecycle.isStopping finalizer branch); read the linked #1023 review comments for the full reports. Add the specified replay cases and wait for history to drain before the checkpoint heartbeat. Run the relevant agents tests; done means the replacement-launch and late-ack reattach cases retain the correct session total and checkpoint history.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Follow-ups from the independent reviews of #1023 (merged as 9e30c8cd). None blocks a release; the first two are small and have a concrete failure window, so do them first. The review comments on #1023 carry the full reports.
Fix first
- Restart usage is emitted after the replacement launch (
packages/agents/src/harness/claude/claude.ts,resume, theSessionTokensUpdatedemit afterlaunchWithRetries). An orchestrator stop during that launch retains the replacement with the oldprocessUsage, and the old process's usage is dropped from the session total on the next reattach. Emit the restart usage right afterScope.close(current.scope), beforelaunchWithRetries. Add a replay case: stop during the replacement launch, reattach, assert the total. - Detach finalizer reads
deliveredonce (packages/agents/src/child-host/process.ts, thelifecycle.isStoppingbranch of the finalizer). A hook response acked after that read, about 50 ms plus the SSH round trip, replays the request and everything after it. Wait forhistoryto drain within the existing 5 s timeout before sending the checkpoint heartbeat. - Replayed assistant messages are counted again on a retained meter (
packages/agents/src/harness/usage.ts,claudeTokenMeterwith a seed). Same window as item 2. Seed the meter's per-message map from the checkpoint, or skip assistant usage for message ids already covered byprocessUsage.
Checkpoint hardening
- No stall guard for a
control_requestthat is never answered (packages/agents/src/harness/claude/sdk.ts,claudeOutputCheckpoint). Today every subtype usine can receive gets a response (verified on SDK 0.3.311: hooks only,bypassPermissions, nocanUseTool, MCP, elicitation or dialog handlers). A future option would stall the checkpoint for the whole session. Release a request when itscontrol_cancel_requestis read, and log the subtype of any request still pending when aresultis handled. Add a test for a blocked hook still pending at the main turn's result (the mutation "result releases requests" survives today). - Lines split on
\nonly, while the SDK'sreadlinealso splits on a lone\r. Only raw non-JSON output can trigger it. Match the SDK. - Test gaps where a mutation survives: the owner ignoring
skipon resume (assert inbuffered-resultthat noToolFinishedorTextOutputis emitted beforeREPLAY_DONE); acknowledging before handling indrain; acontrol_responsesplit across two input frames.
Effect shape
- Mutable closures shared across fibers:
pending,input,answeredinclaudeOutputCheckpoint(three fibers),pendinganddeliveredinremoteProcess(two fibers; today the worst case is an olderdeliveredwritten after a newer one, more replay, never less),let acknowledgeOutputinchild-host/sdk.tsreassigned from the forkedrunProcesswith a silent drop before the spawn. OneRefwithRef.modifyper owner, and aDeferredfor the handle. readOutputis typed with aSessionOperationErrorit never produces.sendinremoteProcessdecodes the Base64 it encoded one line earlier; keep the bytes.remoteProcess,startChildProcessandsdkProcessSpawnernow take six positional arguments; take an options record.- A
ChildProcessLostduring the resume launch fails an idle or paused child. Accepted bound; revisit only if #603 shows a wake-sleep-wake pattern.
Observed once
The full @usine/agents suite failed once in five Linux container runs right after a mutation loop (288 passed otherwise); the failing test name was not captured and the failure did not reproduce. Watch test (rest) on main for a flaky agents test.
- Lingua principale
- TypeScript
- Stelle
- 1
- Fork
- 0
- Merge medio
- 3h 47m
- PR unite (30g)
- 388
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di basaltbytes/usine
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
basaltbytes/usine#1032 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 70/100
basaltbytes/usine#1045 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 73/100
basaltbytes/usine#1044 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
basaltbytes/usine#1042 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
basaltbytes/usine#1041 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di basaltbytes/usine
Issue simili
-
documentation good first issue roadmap
Difficoltà 1/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
resend/react-email#3876 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
siyuan-note/siyuan#21324 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
dmno-dev/varlock#1279 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
himynameisdave/bsky-profanity-counter#59 ·
I maintainer di solito rispondono entro 1 giorno