fix(byoa): complete engine registry wiring and default model pins for gemini and qwen - #163
Conversation
… gemini and qwen - Fix authFailureHint in daemon.ts incorrectly advising users to open Codex on Gemini and Qwen auth/quota errors - Fix triageModel in daemon.ts falling through to <cursor-default> instead of using gemini-2.5-flash-lite and qwen3-coder-flash - Add CUMORA_DEFAULT_GEMINI_MODEL and CUMORA_DEFAULT_QWEN_MODEL fallbacks to listAgentsForComputer in registry.ts - Enforce strict typing on ENGINE_BINS with Record<Exclude<EngineId, 'managed'>, string> - Extend scripts/guard-engine-registry.mjs to assert authFailureHint, triageModel, listAgentsForComputer, and ENGINE_BINS across all engines - Update docs/COORDINATION.md and .env.example with missing BYOA default model environment variables - Add unit tests for authFailureHint across all engines and default model pins
|
I wrote the gemini and qwen adapters (#99, #113) and the registry guard (#114), so these are my loose ends — thanks for running them down. I checked out the branch and exercised the guard rather than reading it, and the new checks do what they claim: I also checked the failure mode of the four new anchors, since a source-scraping check that silently matches nothing is worse than no check. They fail closed — rewriting Two things I'd change, both about the fallbacks rather than the wiring:
return 'Sign in to that engine\'s CLI on that computer (or fix its API key / quota), then wake the agent again.'Neither blocks the fix; the wiring itself and the guard coverage look right to me. |
Resolves the doc-comment conflict in AgentRunner.triageModel() with yetone#163 (gemini/qwen/cursor pricing branches): the agent pin is consulted first, then the per-engine aliases from main. Claude-Session: https://claude.ai/code/session_01SevbW9qCBbzrjfLMy14A31
Summary
When Bring-Your-Own-Agent (BYOA) engines
geminiandqwenwere added, several downstream mapping and fallback sites were not updated:daemon.tsauth failure hints:authFailureHint()lacked branches forgeminiandqwen, falling through toreturn 'Open Codex on that computer and refresh its login or quota, then wake the agent again.'.daemon.tstriage model resolution:triageModel()lacked branches forgeminiandqwen, falling through to<cursor-default>in the LLM cost ledger (llm_calls) rather than using their respective triage models (gemini-2.5-flash-liteandqwen3-coder-flash).registry.tsdefault model pins:listAgentsForComputer()did not handleCUMORA_DEFAULT_GEMINI_MODELandCUMORA_DEFAULT_QWEN_MODEL, causing agents without explicit model overrides to receivenullinstead of the deploy-level default.registry.tstype safety:ENGINE_BINSwas declared asRecord<string, string>. It is now typed asRecord<Exclude<EngineId, 'managed'>, string>(consistent withPAIRABLE) so missing engines are caught at compile time.guard-engine-registry.mjs: Extended to assertauthFailureHint,triageModel,listAgentsForComputer, andENGINE_BINSacross all engines inENGINE_IDS.docs/COORDINATION.mdand.env.examplewithCUMORA_DEFAULT_PI_MODEL,CUMORA_DEFAULT_GEMINI_MODEL,CUMORA_DEFAULT_QWEN_MODEL, andCUMORA_DEFAULT_ANTIGRAVITY_MODEL.Testing
npm run lint: 452 files checked, 0 errors, 0 warnings.npm run typecheck&npm run server:typecheck: 0 errors.npm run guard:big-brain,guard:llm-tracked,guard:engine-registry: all passed.npm test: 1058 passing (addedserver/src/__tests__/agents-computer-daemon-auth-hint.test.tsand updatedagents-computer-engine-detect.test.ts).npm run test:integration: 269 passing.