Skip to content

refactor(cognition): drop TS slot coord from generateResponse (Rust admits now)#1407

Merged
joelteply merged 1 commit into
canaryfrom
feat/drop-inference-coordinator-from-generate-response
May 18, 2026
Merged

refactor(cognition): drop TS slot coord from generateResponse (Rust admits now)#1407
joelteply merged 1 commit into
canaryfrom
feat/drop-inference-coordinator-from-generate-response

Conversation

@joelteply
Copy link
Copy Markdown
Contributor

Summary

Follow-up to #1402. Joel's commit a89c8ab (admit generate-response through Rust resource gate) added ResourceAdmissionGate inside cognition/generate_response.rs::evaluate_response. The TS-side InferenceCoordinator.requestSlot/releaseSlot calls in AIDecisionService.generateResponse were now redundant — double-coordinating the same path.

Per directive: hosts should not coordinate slots outside Rust. This PR removes them.

What changes

  • AIDecisionService.generateResponse:
    • Drop InferenceCoordinator.requestSlot / releaseSlot (both 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)
  • 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. 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 — clean
  • ESLint baseline held at 5435 (no new errors)
  • scripts/ratchet/persona-ts-ratchet.sh check — passes (Lane F ratchet now watches src/system/ai/server after fix(ratchet,#1405): cover AI server cognition shims #1406; deletion is consistent with baseline, no refresh needed)
  • Grep verified: zero TS callers of AIDecisionService.generateResponse pass isMentioned or messageId
  • CI green

Refs

🤖 Generated with Claude Code

…(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>
@joelteply joelteply merged commit 656ecbd into canary May 18, 2026
3 checks passed
@joelteply joelteply deleted the feat/drop-inference-coordinator-from-generate-response branch May 18, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant