Add profile-based LLM routing and tighten manager-worker dispatch tracking#2
Add profile-based LLM routing and tighten manager-worker dispatch tracking#2RussellLuo merged 5 commits intoOpenCSGs:mainfrom
Conversation
Review suggestion 1Recommended configuration structure:
# Generated by csgclaw onboard.
[server]
listen_addr = "0.0.0.0:18080"
advertise_base_url = ""
access_token = "your_access_token"
[bootstrap]
manager_image = "ghcr.io/russellluo/picoclaw:2026.4.8.1"
[models]
default = "codex:gpt-5.4"
[models.providers.codex]
models = ["gpt-5.4"]
provider = "llm-api"
base_url = "http://127.0.0.1:8317/v1"
api_key = "local"
[models.providers.infini]
models = ["glm-5"]
base_url = "https://cloud.infini-ai.com/maas/v1"
api_key = "sk-xxxx"References:
Review suggestion 2csgclaw onboard --profile default --default-profile default --base-url <url> --api-key <key> --model-id <model> [--reasoning-effort <effort>]TODO: need to discuss this part further. My understanding of Review suggestion 3Packaging "workspace/config/skills" for PicoClaw directly in CSGClaw will introduce significant complexity. In addition, we may support other xxClaw variants in the future, which would further increase the complexity. For now, I will build an image using your latest skill. TODO: need to discuss the follow-up optimization strategy together. Review suggestion 4Consider removing comments like the following: They are too detailed and numerous for inline comments. When needed, we can rely on AI to interpret them instead. |
011f209 to
7d2000a
Compare
Suggestion 1
[server]
listen_addr = "0.0.0.0:18080"
advertise_base_url = ""
access_token = "your_access_token"
[bootstrap]
manager_image = "ghcr.io/russellluo/picoclaw:2026.4.8.1"
[models]
default = "codex.gpt-5.4"
[models.providers.codex]
base_url = "http://127.0.0.1:8317/v1"
api_key = "local"
models = ["gpt-5.4"]
reasoning_effort = "medium"Review suggestion 2Somehow I got your point (maybe). Just simplified it to : csgclaw onboard --base-url <url> --api-key <key> --models <model[,model...]> [--reasoning-effort <effort>]BTW, I think we can make the initialization steps (with interactions to ask users to type) to onboard in the main Review suggestion 3Not get it, I need more context. But I strongly agree that we should be claw-insensitive. Review suggestion 4My bad, comments eliminated. |
bf3a923 to
8e14a54
Compare
| - 服务端会根据 `bot_id` 对应 agent 的 `profile` 解析实际模型配置,并在响应中保留已解析快照字段 | ||
| - box 内看到的是统一的 OpenAI 兼容接口;不会拿到宿主机上的真实上游 `api_key` | ||
|
|
||
| ### `POST /api/bots/{bot_id}/llm/v1/chat/completions` |
There was a problem hiding this comment.
Who's this API meant for?
There was a problem hiding this comment.
It is meant for the bot runtime inside the box, mainly PicoClaw manager/worker processes.
More precisely: it is CSGClaw’s internal OpenAI-compatible LLM bridge, so a bot can call a stable /v1/chat/completions endpoint while the server resolves the bot’s actual profile, model_id, and upstream credentials on its behalf.
We don't package workspace/skills/config for now, but we did the LLM bridge for:
- exists to decouple the box runtime from real upstream model configuration.
- give PicoClaw inside the box one stable OpenAI-compatible endpoint
- let CSGClaw resolve the bot’s actual profile, model_id, and defaults on the server side
- prevent exposing real upstream base_url and api_key inside the container
- make per-agent model routing possible without changing PicoClaw (in next change, I want to introduce that every role/agent could have a different model)
This PR introduces profile-based LLM routing for agents and tightens the manager-worker dispatch workflow.
manager_worker_api.pytracking so task handoff stays sequential and depends on bothtodo.jsonprogress and in-room worker replies.Since the config has been enhanced, my local config looks like this. And I use https://github.com/router-for-me/CLIProxyAPI to leverage local codex as an API proxy.