Skip to content

fix(kbc): bound worker shutdown and preserve recovery ownership - #601

Closed
LikiosSedo wants to merge 2 commits into
mainfrom
feat/kb-conversation-execution
Closed

LikiosSedo wants to merge 2 commits into
mainfrom
feat/kb-conversation-execution

Conversation

@LikiosSedo

@LikiosSedo LikiosSedo commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator

Planner and batch sessions previously replaced the persistent authoring client and shared reply/completion state. Give each internal step its own client, task and reply. SDK connection and teardown stay in the same task; confirmed teardown permits the existing batch retry, while unconfirmed teardown prevents workspace reuse, synchronization, planner fallback and finalization.

Bound the interrupt call and worker cleanup so a stalled SDK cannot hold execution indefinitely. Cleanup failure emits worker_teardown_failed; Runtime persists and acknowledges the fatal error, then closes the relay so its existing cleanup disposes the box. It does not consume later artifacts from that worker. A late interrupt failure cannot reap a successor client. User cancellation stays cancelled. Close Claude subprocess pipes after SDK disconnect, including unread output from an aborted tool turn.

The command protocol and artifact/checkpoint commit contract remain compatible. Recovery schedules and ticket-repair admission remain control-plane responsibilities. This change does not add a persistent ticket-repair queue. Two existing self-check assertions are also aligned with the current fixture line numbering and bounded-repair contract.

Validation:

  • Regression tests first reproduced unbounded cleanup, a hanging interrupt call, artifact consumption after a fatal error, Claude's unclosed stdout after cancellation, and a late watchdog failure cancelling a successor.
  • npm run build and final tsc --noEmit passed; npm test: 7,609 passed.
  • Combined KBC domain, ownership, Pi/Claude SDK, file-tool, event-relay and recovery suites: 293 passed. SDK tests use local synthetic model servers.
  • Standalone test_compile_box.py HTTP/SSE protocol smoke passed.
  • Real Pi and Claude SDK tests cover host-tool writes and cancellation through the internal-step driver. Claude cancellation also asserts process exit and closed stdout.

Rollout: ship matching Runtime and KBC box images; Runtime may be upgraded first. Existing boxes retain their original image. No image publication, cluster deployment or hosted-model acceptance was performed for this revision.

@LikiosSedo
LikiosSedo force-pushed the feat/kb-conversation-execution branch from 38582d7 to 8a6f0f0 Compare September 14, 2026 06:39
@LikiosSedo
LikiosSedo force-pushed the feat/kb-conversation-execution branch from 8a6f0f0 to eef8430 Compare September 14, 2026 11:40
@LikiosSedo LikiosSedo changed the title refactor(kbc): isolate internal worker ownership from authoring sessions fix(kbc): bound worker shutdown and preserve recovery ownership Sep 14, 2026
@LikiosSedo
LikiosSedo force-pushed the feat/kb-conversation-execution branch from eef8430 to 5387c78 Compare September 14, 2026 11:46
@LikiosSedo

Copy link
Copy Markdown
Collaborator Author

Superseded. Siclaw delivery has moved off this public repository; this change is continuing on the internal Siclaw repo. Closing the public PR.

@LikiosSedo LikiosSedo closed this Sep 15, 2026
@jacoblee-io
jacoblee-io deleted the feat/kb-conversation-execution branch September 25, 2026 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant