Engineering/AI documentation
Chat Steering
Steering controls collect lightweight user guidance that can shape downstream assistant behavior and project context.
Concepts: rag
Implementation Summary
Steering controls collect lightweight user guidance that can shape downstream assistant behavior inside the active project only. Every steering message, follow-up, queue read, queue clear, abort, and status request carries an explicit project_id, verifies that the project exists, and enforces project access before it touches the in-memory agent queue.
Frontend Surface
frontend/src/components/common/SteeringInput.tsxfrontend/src/components/chat/ChatView.tsxfrontend/src/components/agents/AgentsView.tsxfrontend/src/lib/researchIntegrityApi.tsbackend/app/api/routes/steering.pybackend/app/core/steering.pybackend/app/core/agent_lifecycle.py
State, API, And Backend Contracts
Stores
SteeringInputreceivesprojectIdfrom the active project store and does not render or send when there is no active project.ChatViewrequests all queue status for the active project only.
API And Backend
POST /api/steering/{agent_id}andPOST /api/steering/{agent_id}/follow-uprequireproject_idin the body.GET /api/steering/{agent_id}/status,GET /api/steering/{agent_id}/queues,DELETE /api/steering/{agent_id}/queues,POST /api/steering/{agent_id}/abort,GET /api/steering/{agent_id}/idle, andGET /api/steeringrequireproject_idin the query string.- The route loads the project, keeps the existing admin gate, and then calls
require_project_access. - Project-owned agents can only be steered for their own project. System agents remain universal identities, but their steering messages are still queued and drained by project.
Architecture Notes
backend/app/core/steering.pystores queue metadata per message and filters bymetadata.project_idfor status, read, clear, abort, and drain operations.- A drain call without a project only sees legacy unscoped messages. Project-bound messages are never drained by a global
agent_idcall. backend/app/core/agent_lifecycle.pydiscovers queued project ids, loads the matching project, skips paused or missing projects, and executes steering withSkillInput.project_id, project context, company context, and project-scoped websocket broadcasts.- Pi-selected chat turns construct a
PiExecutionServicesteering binding with the authenticated agent and project ids before calling the worker, so queued steering/follow-up/abort controls retain the same project boundary through the live Pi turn.
Agents, Skills, LLM, MCP, And Permissions
- Steering is security-sensitive because a message can contain project research context and can trigger skill or LLM execution.
- The API requires admin access plus project authorization, and queue contents are filtered by active project before being returned to the browser.
- Project-scoped database agents reject steering requests for any other project.
- Universal/system agents can be steered only through project-bound queue messages, so one project cannot see or drain another project's pending guidance.
Tests And Verification
tests/test_steering_api.pytests/test_steering_manager.pytests/test_steering_project_scope_contracts.pytests/pi_production/test_scenario_steering.py
Related Features
Related Concepts
Compass Evidence
- Spec/task: CF-SPEC-87 / CF-1117
- Inventory source:
docs/features/inventory.json
When To Update
- Update this page whenever the listed UI components, stores, routes, model behavior, permissions, or tests change.
- Regenerate the site and machine manifests with
python scripts/feature_docs.py --seed-missing --generate-site --check.