setup: offer the agent's on-demand camera mode, defaulting to on_demand (#179) - #182
setup: offer the agent's on-demand camera mode, defaulting to on_demand (#179)#182Adityakk9031 wants to merge 3 commits into
Conversation
|
@jeqcho have a look |
|
Thanks @Adityakk9031! CI on this branch is green, but it now has merge conflicts with |
|
@jeqcho hey conflict are fixed have a look |
|
Thanks @Adityakk9031 — you did resolve the conflicts, but |
jeqcho
left a comment
There was a problem hiding this comment.
Thanks @Adityakk9031 — this lands exactly what #179 asked for, and the fiddly part (teaching the renderer a second managed section) came out clean.
What I checked:
- Scope matches the issue. The wizard suggests
on_demand; the plugin default staysalways, so programmatic and CI callers are untouched. Thepolicy_args_ownerscoping (defaults.py:219,cli.py:1420) keeps a carriedimageskey inert if the policy later changes, so the raw carry-through in the renderer is safe. - Renderer. The new
[policy.args]block insrc/inspect_robots/_setup.py(_render_config) mirrors the[embodiment.args]block exactly: managed keys first, unmanaged keys carried raw, multiline\n→\n\tescaping, empty-section suppression, and the section correctly excluded from the generic carried loop. No scoping hazards inrun_setup—policy_argsandmanaged_policy_argsare always bound before_render_config, and every abort path returns before rendering. - Tests. All new branches are covered (default suggestion, explicit
always, preservation on re-run, invalid existing value falling back toon_demand, renderer unit test, empty-managed-args edge), which should keep the 100% coverage gate green. - Docs. README,
cli.md, andquickstart.mdall updated per the issue.
Two tiny non-blocking nits:
plugins/inspect-robots-agent/README.mdline 222: the amended parenthetical runs long compared to the surrounding ~80-col wrap; consider rewrapping.- When an existing config has an invalid
imagesvalue, the wizard silently drops it and suggestson_demand(tested, and a reasonable choice) — a one-line dim note telling the operator their old value was discarded would be a nice touch, but happy to leave it.
One ask before we can merge: the branch is based on an older main and currently conflicts — _setup.py has moved a fair bit since (the wizard grew several sections). Could you rebase onto the latest main? Worth re-running the setup tests after the rebase since the scripted-input sequences assume the current six [defaults] prompts (they do still match today's suggestions). CI can gate it once the rebase is up, and I'm happy to merge then.
Closes #179.
Problem
-P images=on_demand(#173, #175) allows theagentpolicy to issuetake_pictool calls for frames on-demand instead of attaching all camera frames to every observation. While this is cheaper and preferable for real rigs, it was only discoverable via the plugin README.inspect-robots setupis where operators configure defaults, but it previously did not prompt foragentpolicy options.Solution
_setup.py):_valid_images_mode()validator ("on_demand"/"always").configured_policy == "agent"that suggestson_demand(explaining the token savings vs model responsibility tradeoff) while preserving any existingimagesconfiguration in[policy.args]on setup re-runs._render_config()to render managed[policy.args]blocks alongside[defaults]and[embodiment.args]while preserving any unmanaged policy args.plugins/inspect-robots-agent/README.mdto note thatinspect-robots setupsuggestson_demandwhile preserving the library defaultalways.docs/guide/cli.mdanddocs/guide/quickstart.mdwizard descriptions.tests/test_setup.py):test_render_config_renders_policy_args.on_demand), explicit selection (always), and config preservation on setup re-runs.Verification
ruff check .— All checks passed.ruff format --check .— All 108 files formatted.pytest tests/test_setup.py— 105 passed, 16 skipped (POSIX/symlink-gated tests skipped on Windows as expected).