Repository navigation
feat(sidecar)!: idle hibernate is the run's own decision; drop agent-lifecycle (CL-8187) - #777
Merged
Merged
Conversation
Idle hibernation is moving from a hub-driven `chatIdleReapMs` sweep to the sidecar's own decision, and `@corbits/agent-lifecycle` is going away. Strip the now-obsolete `chatIdleReapMs`/`HUB_CHAT_IDLE_REAP_MS` fixtures and assertions, point the sidecar teardown-flavor suite at the router's own `IDLE_HIBERNATE_UNDEPLOY_REASON` export, and add `idleHibernateMs` to the sidecar config fixture.
…gent-lifecycle (CL-8187) Stock Interchange has no undeploy route, so a reaper workflow can't exist yet (tracked upstream separately). Idle hibernation moves into the sidecar's own workflow-host wiring instead: it already sees every inbound mail frame, so it now stamps a per-run last-activity clock there and, past the threshold `CHAT_IDLE_HIBERNATE_MS` carries, tears the run down itself with the same state-preserving `IDLE_HIBERNATE_UNDEPLOY_REASON` flavor the hub used to drive. `packages/agent-lifecycle` is deleted along with it: chat's wake-on-mail path (`wakeByAddressBounded`) keeps its own small `pendingWakes` coalescing map instead of borrowing the package's, so the CL-7214 concurrent-wake protection is unchanged; the idle-sleep tracking (`track`/`untrack`/`recordActivity`, the hub's `chatIdleReapMs` knob, and `chatPlatform.recordActivity`) is gone because nothing drives it from the hub anymore. Cuts every caller: `packages/chat`, `packages/agent-directory`'s one-shot prompt runner (its unused `lifecycle` hook), `apps/hub` (config knob, wiring, comments), package.json deps, tsconfig references, and the report-error baseline entry the deleted package owned.
TheGreatAxios
force-pushed
the
cl-8187-drop-agent-lifecycle
branch
from
September 17, 2026 18:43
06a474f to
eb2beb4
Compare
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
apps/sidecar/src/workflow-host-wiring/index.tsstamps a per-run last-activity clock on every inbound mail frame it dispatches, and its own sweep tears an idle run down with the same state-preservingIDLE_HIBERNATE_UNDEPLOY_REASONflavor the hub used to drive, once the run has been idle past the newCHAT_IDLE_HIBERNATE_MSsidecar env threshold (arktype-parsed alongside the other sidecar timing knobs).packages/agent-lifecycleis deleted. Chat's wake-on-mail path (wakeByAddressBoundedinpackages/chat/src/platform-adapter.ts) keeps its own smallpendingWakescoalescing map inline, so the CL-7214 concurrent-wake protection is unchanged; the idle-sleep tracking half of the old package (track/untrack/recordActivity, the hub'schatIdleReapMs/HUB_CHAT_IDLE_REAP_MSknob,chatPlatform.recordActivity) is gone since nothing drives it from the hub anymore. Wake-on-mail relaunch behavior is otherwise unchanged.packages/chat,packages/agent-directory's one-shot prompt runner (itslifecyclehook was unused by any caller),apps/hub(config knob, wiring, comments), package.json deps, tsconfig references (regenerated viabun scripts/generate-tsconfig-references.ts), and the report-error baseline entry the deleted package owned.Deleted tests
Per this hard-cutover ruling, the following were deleted rather than adapted, since they encoded the old hub-driven idle-sweep behavior that no longer exists in chat:
packages/chat/test/platform-adapter.test.ts: thedescribe("lifecycle wiring", ...)idle-sweep tests (busy-guard, idle-reap, idle-reap-then-relaunch regression pin, and the two "installs a sweep interval" tests), and the duplicate "...when lifecycle is configured" variant of the relaunch test (the "...is not configured" variant was kept and renamed, since that's the only remaining code path).packages/agent-directory/src/one-shot-prompt.test.ts: thecreateFakeLifecyclefixture and its track/recordActivity/untrack assertions (thelifecyclehook was dead code — nothing ever passed it in production).Test plan
bun run typecheckbun run lintbun run check:structuralbun --cwd apps/sidecar testbun --cwd packages/agent-directory testbun --cwd packages/chat testbun --cwd apps/hub test