Skip to content

Make chat routing mandatory and document retrieval opt-in#34

Merged
KostasCherv merged 1 commit into
mainfrom
codex/always-on-router
Jul 14, 2026
Merged

Make chat routing mandatory and document retrieval opt-in#34
KostasCherv merged 1 commit into
mainfrom
codex/always-on-router

Conversation

@KostasCherv

Copy link
Copy Markdown
Owner

Summary

  • make chat action routing mandatory for workspace and agent chat
  • default the router to the registered main LLM while preserving router-specific overrides
  • retrieve document collections only after an explicit answer_from_rag decision
  • gate RAG citations on that decision and keep explicit session attachments scoped separately
  • return structured router_error failures instead of silently retrieving all documents
  • update configuration docs and deterministic regression coverage

Root cause

When the router was disabled or unavailable, should_use_workspace_resources(None) defaulted to retrieving every ready workspace document. Citation selection then treated retrieved context as supporting evidence even for direct messages such as hi, so the backend emitted an unrelated citation that the UI rendered.

User impact

Greetings and other direct/tool/clarification turns no longer query or cite workspace or agent document collections. Document retrieval remains available for explicit RAG routes, and router failures terminate without retrieval.

Validation

  • uv run pytest -q tests/test_api.py tests/test_rag_chat_helpers.py tests/test_citations.py tests/test_llm_factory.py tests/test_ai_regression_gate.py — 166 passed
  • uv run ruff check src tests — passed
  • full suite after rebase — 574 passed, 1 unrelated concurrency timing test failed once while reaching Supabase; the exact failing test passed immediately on rerun
  • graphify update . — completed

@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cortex Ready Ready Preview, Comment Jul 14, 2026 8:58am

@KostasCherv
KostasCherv marked this pull request as ready for review July 14, 2026 09:02
@KostasCherv
KostasCherv merged commit aa7e332 into main Jul 14, 2026
5 checks passed
@KostasCherv
KostasCherv deleted the codex/always-on-router branch July 14, 2026 09:04
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