Repository navigation
Modification Scenarios
github-actions[bot] edited this page Oct 19, 2026
·
1 revision
Deep-dive companion to the quick index in
AGENTS.md→ "Common Modification Scenarios". Step-by-step recipes for every recurring change type. For the broader contribution flow (local loop vs CI, reconciliation), see docs/ops/CONTRIBUTION_GOLDEN_PATH.md.
- Check
docs/reference/REMOVED_PROVIDERS.mdfirst — providers removed at their operator's request must never be reintroduced (guarded bytests/unit/removed-providers-blocklist.test.ts) - Register in
src/shared/constants/providers.ts(Zod-validated at load) - Add executor in
open-sse/executors/if custom logic needed (extendBaseExecutor) - Add translator in
open-sse/translator/if non-OpenAI format - Add OAuth config in
src/lib/oauth/constants/oauth.tsif OAuth-based — if the upstream CLI ships a public client_id/secret, embed viaresolvePublicCred()(seedocs/security/PUBLIC_CREDS.md), never as a literal - Register models in
open-sse/config/providerRegistry.ts - Write tests in
tests/unit/(include the publicCreds shape assertion if you added a new embedded default)
- Add the provider's ID to the
DUAL_AUTH_PROVIDER_IDSset insrc/shared/constants/providers.ts. This flags the frontend to render the multi-key textarea input instead of a single-line password input. - Update the
authHintfor the provider (insrc/shared/constants/providers.tsorsrc/shared/constants/providers/oauth.ts) to inform users that they can provide multiple keys separated by commas. - Each key is stored as its own provider connection row (the bulk-add flow parses one key per line via
parseBulkApiKeys()insrc/shared/utils/bulkApiKeyParser.ts). At request time,getProviderCredentials()insrc/sse/services/auth.tsautomatically selects and rotates/falls back between a provider's connections — see "Connection Cooldown" in RESILIENCE_GUIDE.md for the fallback mechanics.
- Create directory under
src/app/api/v1/your-route/ - Create
route.tswithGET/POSThandlers - Follow pattern: CORS → Zod body validation → optional auth → handler delegation
- Handler goes in
open-sse/handlers/(import from there, not inline) - Error responses use
buildErrorBody()/errorResponse()fromopen-sse/utils/error.ts(auto-sanitized — never puterr.stackorerr.messageraw in the body). Seedocs/security/ERROR_SANITIZATION.md. - Add tests — including at least one assertion that error responses do not leak stack traces (
!body.error.message.includes("at /"))
- Create
src/lib/db/yourModule.ts— importgetDbInstancefrom./core.ts - Export CRUD functions for your domain table(s)
- Add migration in
src/lib/db/migrations/if new tables needed - Write tests
- Add tool definition in
open-sse/mcp-server/tools/with Zod input schema + async handler - Register in tool set (wired by
createMcpServer()) - Assign to appropriate scope(s)
- Write tests (tool invocation logged to the
mcp_tool_audittable)
- Create skill in
src/lib/a2a/skills/(6 already exist: smart-routing, quota-management, provider-discovery, cost-analysis, health-report, list-capabilities) - Skill receives task context (messages, metadata) → returns structured result
- Register in
A2A_SKILL_HANDLERSinsrc/lib/a2a/taskExecution.ts - Expose in
src/app/.well-known/agent.json/route.ts(Agent Card) - Write tests in
tests/unit/ - Document in
docs/frameworks/A2A-SERVER.mdskill table
- Create agent class in
src/lib/cloudAgent/agents/extendingCloudAgentBase(4 already exist: codex-cloud, devin, jules, cursor-cloud) - Implement
createTask,getStatus,approvePlan,sendMessage,listSources - Register in
src/lib/cloudAgent/registry.ts - Add OAuth/credentials handling if needed (
src/lib/oauth/providers/) - Tests + document in
docs/frameworks/CLOUD_AGENT.md
- Create installer in
src/lib/services/installers/{name}.tsmodeled onninerouter.ts(userunNpmfrominstallers/utils.ts— no shell interpolation, hard rule #13). - Register the service in
src/lib/services/bootstrap.ts(add toSERVICES[]array and extendbuildSpawnArgsFactory()). - Add a DB seed row for the new service in
src/lib/db/migrations/(version_managertable,status='not_installed',auto_start=0). - Create 8 API endpoints under
src/app/api/services/{name}/(_lib.ts,install,start,stop,restart,update,status,auto-start,auto-restart-adopted). All delegate errors throughcreateErrorResponse(). The sharedlogsendpoint is already wired via[name]/logs/route.ts. - Verify
/api/services/is inLOCAL_ONLY_API_PREFIXESinsrc/server/authz/routeGuard.ts; add a test assertingisLocalOnlyPath()returnstruefor the new prefix if you add one (hard rule #17). - Add a UI tab in
src/app/(dashboard)/dashboard/providers/services/tabs/reusingServiceStatusCard,ServiceLifecycleButtons,ServiceLogsPanel. - Document in
docs/frameworks/EMBEDDED-SERVICES.md(update §1 service table + §4 API reference) anddocs/openapi.yaml. - Write tests: unit (
tests/unit/services/), integration (tests/integration/services/, gated byRUN_SERVICES_INT=1), and updatedocs/ops/RELEASE_CHECKLIST.mdsmoke section.
- Guardrail:
src/lib/guardrails/→ docs:docs/security/GUARDRAILS.md - Eval suite:
src/lib/evals/→ docs:docs/frameworks/EVALS.md - Skill (sandbox):
src/lib/skills/→ docs:docs/frameworks/SKILLS.md - Webhook event:
src/lib/webhookDispatcher.ts→ docs:docs/frameworks/WEBHOOKS.md - Log-export destination: add
src/lib/logExport/destinations/<name>.ts+ one line insrc/lib/logExport/registry.ts→ docs:docs/frameworks/LOG-EXPORT.md. The runner, REST layer and dashboard form all read the registry, so nothing else changes.
OmniRoute · Website · npm · Docker Hub
- Setup Guide
- User Guide
- Features
- Quick Start (Docker)
- Electron Desktop App
- Termux (Android)
- PWA Guide
- MCP Server
- A2A Server
- Agent Protocols
- OpenCode Plugin
- Webhooks
- Cloud Agents
- Skills
- Memory
- Evals
- Gamification
- Guardrails
- Compliance
- Error Sanitization
- Public Credentials
- Route Guard Tiers
- Stealth Guide
- CLI Token Auth