feat(dashboard): provider add (with connectivity test) + provider/bot control#54
Merged
Conversation
… control
The last two control batches — providers and the bot — now run from the dashboard.
- provider.add — a form (name · base URL · key-env · model) adds an OpenAI-compatible provider
(reuses buildCustomEntry + addProviderToConfig) AND immediately TESTS it: probeProvider hits
{baseUrl}/models with the key from the named env var and reports ✓ reachable / ✗ <reason>
(401 = bad key, missing env var, timeout). The secret stays in ~/.qodex/.env — never the form.
- provider.test — a Test button on every provider row runs the same probe on demand.
- provider.remove — Remove button on custom providers.
- bot.start / bot.stop — start/stop the Telegram/Discord/Slack bot as a detached process tracked
by ~/.qodex/bot.pid; the panel shows running(pid)/stopped via a kill(pid,0) liveness check.
New modules: src/setup/provider-test.ts (PURE buildModelsUrl + best-effort probeProvider) and
src/cli/bot-process.ts (PURE pidFilePath/parsePid + start/stop/status). gatherDashboardData adds
a `custom` flag per provider + bot status.
+12 tests (models-url, missing-key probe, pid parsing/path, provider/bot dispatch validation,
live render wires the forms). Full suite 1375 green; tsc clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The final two control batches toward every capability controllable: managing providers and the bot from the dashboard — with the connectivity test you asked for.
What
provider.add— a form (name · base URL · key-env · model) adds an OpenAI-compatible provider (reusesbuildCustomEntry+addProviderToConfig) and immediately tests it:probeProviderhits{baseUrl}/modelswith the key from the named env var and reports ✓ reachable — N models / ✗ <reason> (401 = bad key, missing env var, timeout). The secret stays in~/.qodex/.env— never the form.provider.test— a Test button on every provider row runs the same probe on demand.provider.remove— a Remove button on custom providers.bot.start/bot.stop— start/stop the Telegram/Discord/Slack bot as a detached process tracked by~/.qodex/bot.pid; the panel showsrunning (pid)/stoppedvia akill(pid, 0)liveness check.New:
src/setup/provider-test.ts(PUREbuildModelsUrl+ best-effortprobeProvider),src/cli/bot-process.ts(PUREpidFilePath/parsePid+ start/stop/status).Safety
Keys never touch the dashboard — only the env-var name does; the secret lives in
~/.qodex/.env. Same local-only + token-gated server. Bot start just spawnsqodex bot(itself deny-by-default).Tests
+12 (models-url trim, missing-key probe without network, pid parsing/path, provider/bot dispatch validation, live render wires the forms). Full suite 1375 green,
tscclean.Dashboard now controls essentially everything
providers (add + test / remove) · model · caching/efficient/memory/sub-agents/learning · schedules (add/enable/disable/remove) + receipts · remember/forget · skill promote/reject · offload · bot start/stop.