Official Codebase of 3DCodeVerse
Python
agents: claude-code's effort is a harness setting, xhigh — no user settings means no inherited effortLevel
gaoypeng1ffb54527b6b
diff --git a/harness/codeverse3d/agents/backends.py b/harness/codeverse3d/agents/backends.pyindex 2d6491e6..cd8d2054 100644--- a/harness/codeverse3d/agents/backends.py+++ b/harness/codeverse3d/agents/backends.py@@ -537,9 +537,9 @@ CLAUDE_SKILL_TOOL = "Skill"#: nothing else. claude-code 2.1.280 otherwise lists 26 more (2026-09-22 rig): the account-#: synced skills and plugins (``anthropic-skills:*``, ``deep-research``, …) come with the#: "user" setting source, so ``--setting-sources project`` drops them — and with them the-#: owner's ~/.claude/settings.json (hooks, env, effortLevel: sessions ran at its "xhigh" and-#: now run at the CLI's default "high"): a session no longer inherits whoever runs the-#: harness. The bundled skills go with ``CLAUDE_CODE_DISABLE_BUNDLED_SKILLS`` (build_env);+#: owner's ~/.claude/settings.json (hooks, env, effortLevel): a session no longer inherits+#: whoever runs the harness, and its effort is stated instead (``Settings.agents.claude_effort``,+#: default "xhigh" — what sessions ran at while they inherited the owner's settings). The bundled skills go with ``CLAUDE_CODE_DISABLE_BUNDLED_SKILLS`` (build_env);#: ``design`` and ``doctor`` survive that switch by design and are hidden by name through the#: documented ``skillOverrides`` setting. Checked against a local fake API and in one live#: subscription session (2026-09-22): the init event lists exactly the routed bundles, and@@ -702,6 +702,8 @@ class ClaudeCodeAgent(_CliAgent):"--allowedTools", ",".join(ALLOWED_TOOLS)]if self.model:argv += ["--model", self.model]+ if effort := get_settings().agents.claude_effort:+ argv += ["--effort", effort]if job.spatial_tools:# written fresh into the harness-owned trajectory dir for THIS session, from# the typed job — never the workspace's .mcp.json, which the agent can rewritediff --git a/harness/codeverse3d/config.py b/harness/codeverse3d/config.pyindex 0e8c6c58..9cd16cd1 100644--- a/harness/codeverse3d/config.py+++ b/harness/codeverse3d/config.py@@ -83,6 +83,12 @@ class Agents(BaseModel):description="`-c model_reasoning_effort=` passed to every `codex:` call (agent and one-shot). ""One of minimal|low|medium|high|xhigh, or '' to leave the choice to ~/.codex/config.toml. ""Override per id with `codex:<model>@<effort>`.")+ claude_effort: str = Field(+ default="xhigh",+ description="`--effort` passed to every `claude-code:` session (low|medium|high|xhigh|max; '' in the "+ "config file leaves it to the CLI). A harness session reads no user settings (`--setting-sources project`), so the "+ "effort is the harness's to state; xhigh is what sessions ran at while they still inherited the "+ "owner's ~/.claude/settings.json (until 2026-09-22).")class Render(BaseModel):diff --git a/harness/tests/agents/test_claude_code.py b/harness/tests/agents/test_claude_code.pyindex 9cbb1f1a..eccadd28 100644--- a/harness/tests/agents/test_claude_code.py+++ b/harness/tests/agents/test_claude_code.py@@ -128,6 +128,16 @@ def test_a_session_sees_only_the_routed_skills(tmp_ws: Workspace):assert "--disable-slash-commands" not in argv # claude-code: "Disable all skills" — the routed ones too+def test_the_effort_is_the_harness_setting_not_the_users(tmp_ws: Workspace, switch):+ """No user setting source means no inherited effortLevel: the harness states it."""+ s = begin_session(AgentJob(workspace=str(tmp_ws.root), prompt="p", spatial_tools=False), "claude-code")+ argv = ClaudeCodeAgent("sonnet", binary="claude").build_argv(s)+ assert argv[argv.index("--effort") + 1] == "xhigh"+ switch("C3D_AGENTS__CLAUDE_EFFORT", "high")+ argv = ClaudeCodeAgent("sonnet", binary="claude").build_argv(s)+ assert argv[argv.index("--effort") + 1] == "high"++def test_the_usage_limit_is_quota_not_a_transient_death(tmp_ws: Workspace, fake_bin, monkeypatch):a = ClaudeCodeAgent("sonnet", binary=fake_bin("claude", FAKE_CLAUDE))monkeypatch.setenv("FAKE_MODE", "usage_limit")