Skip to content

Report each claw's effective context window - #2

Open
teddytennant wants to merge 1 commit into
TokenRhythm:mainfrom
teddytennant:report-context-window
Open

Report each claw's effective context window#2
teddytennant wants to merge 1 commit into
TokenRhythm:mainfrom
teddytennant:report-context-window

Conversation

@teddytennant

Copy link
Copy Markdown

Toward #1.

Running the shipped example configs through a reader shows the spread the issue is asking about:

claw       context window  source
----------------------------------------------------------------
generic             unset  claw_configs/generic/mykey.py
                           note: GenericAgent exposes max_tokens (output), not a context budget
hermes            200,000  claw_configs/hermes/config.yaml
nanobot             unset  claw_configs/nanobot/config.json
                           note: unset; claw falls back to its runtime default
openclaw            unset  $OPENCLAW_STATE_DIR/openclaw.json
zeroclaw          128,000  claw_configs/zeroclaw/config.toml

So hermes runs at 200k, zeroclaw at 128k, and nanobot at whatever NanoBot defaults to. The README lists same prompt, no network answers, future-commit stripping and per-instance isolation as properties enforced for every claw, and context budget is not on that list even though it moves the result.

claw_swebench/context_window.py reads the budget out of each claw's live config under that claw's own key: custom_providers[<model.provider>].context_length for hermes, agent.max_context_tokens for zeroclaw, agents.defaults.contextWindowTokens for nanobot and openclaw. It reads rather than asserts, so the record is what the claw actually ran with instead of what the harness believes. A missing or malformed config reports a note and returns None; it never raises into a run.

Three places consume it. run_infer.py logs the budget at startup and warns when it is unset. Each instance's metadata.json gains a claw_config block with claw, model, timeout, max_turns and the context window plus the file and key it came from, so an old artifact directory can be audited later. python3 -m claw_swebench.context_window prints the table above.

I did not normalize anything. No claw's behaviour changes and no published number moves. The nanobot example still ships without contextWindowTokens; its _comment now names the key and says the budget is unset, because picking a number for it changes nanobot's score and that is a call about the benchmark, not about the plumbing. If you want the normalized version, say which budget and I will add the flag that writes it into each claw's config.

What I ran: python3 -m unittest discover -s tests, 17 tests covering the readers, the failure modes and the shipped examples. run_infer.py --claw {nanobot,hermes,zeroclaw} --dataset verified far enough to see the startup line for each, which is where the numbers above came from. I did not run inference or evaluation, so there is no before/after on any score here.

The thing this does not do is tell you what the reported nanobot run used, since that lived in a local config.json that is gitignored. That one is still yours to answer, and adding the per-claw configs behind the leaderboard runs would close the rest of #1.

The harness holds the prompt, the patch collection and the isolation constant
across claws, but not the context budget, and nothing recorded what each claw
actually ran with. Reading the shipped example configs: hermes pins 200000 for
openrouter, zeroclaw pins 128000, nanobot sets nothing and falls back to its
own default.

Add claw_swebench/context_window.py, which reads the budget out of each claw's
live config under that claw's own key: context_length for hermes,
max_context_tokens for zeroclaw, contextWindowTokens for nanobot and openclaw.
Reading it rather than asserting it here means the record reflects what the
claw ran with, and a broken config reports instead of raising.

run_infer.py logs the budget at startup and warns when it is unset. Every
instance's metadata.json gains a claw_config block carrying claw, model,
timeout, max_turns and the context window with the file and key it came from.
python3 -m claw_swebench.context_window prints the spread across claws.

No claw's behaviour changes and no published number moves. The nanobot example
still ships without contextWindowTokens; its _comment now says so and names
the key, since normalising the budget is a call about the benchmark rather
than about the plumbing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant