mirror of
https://github.com/andrewyng/openworker.git
synced 2026-11-14 14:07:13 +00:00
OpenWorker had no way to choose how hard a model thinks per reply; the level
was whatever each endpoint defaulted to (Anthropic: high; Kimi K3 on
Together: max), and a run record could not state it.
- `Config.reasoning_effort` (low | medium | high | xhigh | max, Anthropic's
vocabulary), config.toml / workspace / `COWORKER_REASONING_EFFORT`,
validated; unset sends nothing so existing requests are unchanged.
- `build_engine` threads it through `model_settings` like `max_tokens`.
- providers/effort.py: the level→parameter tables and the nearest-supported
rule (ties go up). Anthropic adaptive models get `output_config.effort`
(per-model support from the effort doc, read 2026-09-08); budget-thinking
models get `thinking.budget_tokens` (2,048 / 8,192 / 16,000 / 24,000 /
32,000, max_tokens floored above); OpenAI-compatible endpoints get
`reasoning_effort` (Kimi K3: low/high/max verified; others the OpenAI
vocabulary). Gemini, Bedrock, Responses: not sent, recorded as such.
- Fallback: an endpoint that rejects the parameter (400 naming it) gets the
request once more without it; the model is remembered for the run.
- Record: `AssistantTurn.effort` → `reasoning_effort` sidecar on every
assistant message and on the ASSISTANT_MESSAGE event: {requested,
effective, param, note}; stripped before provider calls. When a level is
configured but the provider reports nothing, the record says so.
- docs/config.example.toml documents the key.
Tests: tests/test_reasoning_effort.py, 40 cases (levels, config layering and
rejection, build_engine plumbing, mapping tables incl. every curated model at
every level, Anthropic complete/stream/budget/fallback/unrelated error,
OpenAI-compatible unset/mapped/fallback, engine record and outbound strip).
33 lines
1.7 KiB
TOML
33 lines
1.7 KiB
TOML
# coworker config — copy to one of:
|
|
# ~/.config/coworker/config.toml (global)
|
|
# <your-project>/.coworker/config.toml (per-workspace, overrides global)
|
|
#
|
|
# All keys are optional; unset keys fall back to built-in defaults.
|
|
|
|
model = "gpt-5.5" # default model id (override per session in the UI/CLI)
|
|
mode = "interactive" # plan | interactive | auto | custom
|
|
max_iterations = 12 # max model<->tool iterations per turn before stopping
|
|
# max_output_tokens = 64000 # per-reply output cap sent as max_tokens (thinking + text +
|
|
# tool arguments). Unset = provider default (32000; Bedrock
|
|
# 4096). Env override: COWORKER_MAX_OUTPUT_TOKENS.
|
|
# reasoning_effort = "high" # low | medium | high | xhigh | max — how hard the model thinks
|
|
# per reply, translated per provider (Anthropic output_config
|
|
# .effort; Together/Moonshot reasoning_effort). Unset = provider
|
|
# default (Anthropic high, Kimi K3 max). Env override:
|
|
# COWORKER_REASONING_EFFORT.
|
|
|
|
# Commands auto-allowed without an approval prompt (prefix match).
|
|
allowed_commands = [
|
|
"ls", "cat", "pwd", "grep", "find",
|
|
"git status", "git diff", "git log",
|
|
"python3", "pytest", "node", "npm",
|
|
]
|
|
|
|
# In "custom" permission mode, these tools are auto-approved (everything else still
|
|
# asks). e.g. auto-accept file edits but keep asking before running shell commands.
|
|
auto_allow = ["write_file", "replace_in_file", "apply_patch", "apply_unified_diff"]
|
|
|
|
# Server (openworker-server) bind address.
|
|
host = "127.0.0.1"
|
|
port = 8765
|