fix: require user to specify the provider

This commit is contained in:
Joe Fleming
2026-03-13 20:45:33 -06:00
parent b6df31fcbf
commit 74a5e70322
9 changed files with 74 additions and 77 deletions

View File

@@ -19,13 +19,14 @@ Docs directory created with 4 files (PRD.md, Architecture.md, API.md, Discoverie
- **lint**: all `${err}` in template literals → `${String(err)}`; `String(args['key'] ?? '')``strArg(args, 'key')` helper; unused `onProgress` param → `_onProgress`; WebSocket `onerror` `err` type is `Event` → use `err.type`
## Work Queue (next steps)
1. [x] Create workspace helper module (src/workspace.ts) with ensureWorkspace() and syncTemplates()
1. [x] Create workspace helper module (src/cli/utils.ts) with ensureWorkspace() and syncTemplates()
2. [x] Create onboard command (src/cli/onboard.ts) with path argument and directory-not-empty guard
3. [x] Update src/cli/commands.ts to use ensureWorkspace() instead of inline mkdirSync
4. [x] Typecheck and lint pass (0 errors)
5. [x] Runtime smoke test: `bun run nanobot --help`
6. [x] Test onboard command: `bun run nanobot onboard [path]`
7. [ ] Test with a real Mattermost config (optional — user can do this)
3. [x] Agent/gateway commands check workspace exists (throw if not found)
4. [x] Added required `provider` field to agent config (values: anthropic, openai, google, openrouter, ollama)
5. [x] Provider resolution uses explicit provider from config (no model prefix parsing)
6. [x] Typecheck and lint pass (0 errors)
7. [x] Test onboard and agent commands work correctly
8. [ ] Test with a real Mattermost config (optional — user can do this)
## Key Decisions Made
- Mattermost channel uses raw WebSocket + fetch (no mattermostdriver, no SSL hack)
@@ -34,3 +35,5 @@ Docs directory created with 4 files (PRD.md, Architecture.md, API.md, Discoverie
- Config is fresh Zod schema (no migration from Python config needed)
- `ollama-ai-provider` package (not `@ai-sdk/ollama` which 404s on npm)
- `strArg(args, key, fallback?)` helper exported from `agent/tools/base.ts` for safe unknown→string extraction
- Agent config requires explicit `provider` field (no more model prefix like "anthropic/claude-...")
- Model names are now just the raw model ID (e.g., "claude-sonnet-4-5" not "anthropic/claude-sonnet-4-5")