refactor(cognition): drop TS slot coord from generateResponse (Rust admits now)#1407
Merged
joelteply merged 1 commit intoMay 18, 2026
Merged
Conversation
…(Rust admits now) Follow-up to #1402. Joel's a89c8ab (admit generate-response through Rust resource gate) added ResourceAdmissionGate inside cognition/generate_response.rs::evaluate_response. TS-side InferenceCoordinator.requestSlot/releaseSlot calls in AIDecisionService.generateResponse are now redundant — they double-coordinate the same path. Per directive: hosts should not coordinate slots outside Rust. This PR removes them. ## What this changes - AIDecisionService.generateResponse: - Drop InferenceCoordinator.requestSlot/releaseSlot calls (success + error paths) - Drop messageId / isMentioned options (slot-coord-specific — unused without slot coord) - Drop messageId derivation + slot-denied fallback throw - Drop LOCAL_MODELS.DEFAULT fallback (Rust evaluate_response carries its own DEFAULT_GENERATE_MODEL constant; passing `undefined` lets Rust apply its default — single source of truth) - Drop LOCAL_MODELS import (no longer referenced in file) - InferenceCoordinator import kept (still used by evaluateGating + checkRedundancy — those still slot-coord because Rust admission hasn't been extended to those paths yet) After this PR: generateResponse is a 25-LOC try/catch around a single IPC call — the thinnest possible shim. Slot leak risk codex flagged on #1402 becomes structurally impossible (no slots = no leaks). ## Verification - npm run build:ts — clean - ESLint baseline held at 5435 (no new errors) - Greppable call sites of AIDecisionService.generateResponse: zero TS callers pass isMentioned or messageId (only a doc reference exists in widgets/WIDGET-ABSTRACTION-BREAKTHROUGH.md to a different daemon) ## Refs - #1402 — PR-3 of the generate_response oxidizer stack - a89c8ab — Joel's commit adding Rust ResourceAdmissionGate - #1385 — completed oxidizer sub-card (now closed) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Follow-up to #1402. Joel's commit a89c8ab (admit generate-response through Rust resource gate) added
ResourceAdmissionGateinsidecognition/generate_response.rs::evaluate_response. The TS-sideInferenceCoordinator.requestSlot/releaseSlotcalls inAIDecisionService.generateResponsewere now redundant — double-coordinating the same path.Per directive: hosts should not coordinate slots outside Rust. This PR removes them.
What changes
AIDecisionService.generateResponse:InferenceCoordinator.requestSlot/releaseSlot(both success + error paths)messageId/isMentionedoptions (slot-coord-specific — unused without slot coord)LOCAL_MODELS.DEFAULTfallback (Rustevaluate_responsecarries its ownDEFAULT_GENERATE_MODELconstant; passingundefinedlets Rust apply its default — single source of truth)LOCAL_MODELSimport (no longer referenced)InferenceCoordinatorimport kept (still used byevaluateGating+checkRedundancy— those still slot-coord because Rust admission hasn't been extended to those paths yet)After this PR
generateResponseis a 25-LOC try/catch around a single IPC call — the thinnest possible shim. The slot leak risk codex flagged on #1402 becomes structurally impossible (no slots → no leaks).Diff
+7 / -30 in 1 file.
Verification
npm run build:ts— cleanscripts/ratchet/persona-ts-ratchet.sh check— passes (Lane F ratchet now watchessrc/system/ai/serverafter fix(ratchet,#1405): cover AI server cognition shims #1406; deletion is consistent with baseline, no refresh needed)AIDecisionService.generateResponsepassisMentionedormessageIdRefs
ResourceAdmissionGatesrc/system/ai/server(MERGED)🤖 Generated with Claude Code