Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions eval/harbor/clawcodex_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,9 +805,19 @@ async def _seed_container_settings(

clawcodex's ``--effort`` flag governs the MAIN loop only; subagents
(Agent tool) resolve effort from ``settings.effort``. Seeding the
container's global config (home-anchored ``~/.clawcodex/config.json``
— the global-config path deliberately does not follow
CLAWCODEX_CONFIG_DIR) makes the requested effort session-wide.
container's global config makes the requested effort session-wide.

The seed is written to ``$CLAWCODEX_CONFIG_DIR/config.json``
(``_CONTAINER_CONFIG_DIR``) — the SAME directory ``_build_env``
points the CLI at. It used to go to home-anchored
``~/.clawcodex/config.json`` under a stale claim that the
global-config path "deliberately does not follow
CLAWCODEX_CONFIG_DIR": ``src/config.py`` has since unified the
config root on ``get_user_config_dir()`` (which honors the env
var), so every home-anchored seed — effort, advisor, vision,
env-block keys, fusion records — was silently inert in the
container. Found when a ``--ak vision=`` run's ``system/init``
advertised no vision tool.

Also forwards the host's stored API keys (the global config's ``env``
block) so tools that need one work inside the container -- WebSearch
Expand Down Expand Up @@ -871,12 +881,16 @@ async def _seed_container_settings(
if not config:
return
payload = json.dumps(config)
# The literal container config dir, NOT "$CLAWCODEX_CONFIG_DIR": this
# exec's env carries only CLAWCODEX_SEED_CONFIG, so the variable would
# expand empty here. _inject_subscription_credentials writes only
# anthropic-oauth.json into the same dir — no clobber.
await self.exec_as_agent(
environment,
command=(
'mkdir -p "$HOME/.clawcodex" && '
f'mkdir -p {_CONTAINER_CONFIG_DIR} && '
'printf \'%s\' "$CLAWCODEX_SEED_CONFIG" > '
'"$HOME/.clawcodex/config.json"'
f'{_CONTAINER_CONFIG_DIR}/config.json'
),
env={"CLAWCODEX_SEED_CONFIG": payload},
)
Expand Down
Loading