oxidizer: AIGenerateServerCommand → cognition/generate-response shim#1438
Merged
Conversation
RAG-mode generation now delegates to Rust via AIDecisionService — the same IPC seam PersonaUser's response path already uses. Rust owns prompt assembly (system prompt + history + time prefixes + hour-gap markers + identity reminder), provider routing, admission gating, timeout, and token-usage stamping (build_response_messages + build_response_generation_request in cognition/generate_response.rs). Direct-message + preview modes stay TS-side: - Direct mode is an introspection/test path that bypasses admission; Rust intentionally does not expose a "skip the gate" code path. - Preview mode reconstructs the request Rust would build as a local mirror. Source of truth is the Rust path; if assembly drifts a `cognition/preview-request` IPC is the fix. Mirrors the pattern from #1421 (should-respond) and #1426 (validate-response-decision). The 100-line of TS message-building that duplicated build_response_messages now lives only in Rust. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 26, 2026
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.
RAG-mode generation now delegates to Rust via `AIDecisionService` — the same IPC seam `PersonaUser`'s response path already uses. Rust owns:
All in `cognition/generate_response.rs::build_response_messages` + `build_response_generation_request`.
What stays TS-side
The preview-mode mirror is the only durable wet-code. If Rust prompt assembly drifts the fix is a `cognition/preview-request` IPC, not maintaining two copies.
Pattern
Mirrors #1421 (`should-respond` → `cognition/should-respond`) and #1426 (`validate-response` → `cognition/validate-response-decision`). The TS direct-message duplicate of `build_response_messages` is gone — Rust owns it.
Verification
🤖 Generated with Claude Code