openclaw - ✅(Solved) Fix sessions_spawn: model parameter silently dropped on ACP runtime branch [2 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#70200Fetched 2026-04-23 07:27:53
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Participants
Timeline (top)
cross-referenced ×2closed ×1commented ×1

Error Message

error: "cron: job execution timed out" durationMs: 3600000

Fix Action

Fix / Workaround

Workaround on my side was disabling the opencode provider in OpenCode's config to force its fallback chain past big-pickle. That is a downstream kludge; the real fix belongs here.

PR fix notes

PR #70207: fix(tools): reject model param on ACP runtime in sessions_spawn

Description (problem / solution / changelog)

Summary

sessions_spawn tool declares a model parameter in its schema and reads it into modelOverride, but the ACP runtime branch passes params to spawnAcpDirect without forwarding model.

What changed

Added a guard that returns a clear error when model is set on the ACP runtime, instead of silently dropping it.

Root Cause

The SpawnAcpParams type has no model field, so the model was always ignored on the ACP branch with no feedback to the caller.

Fix

Returns status: "error" with a descriptive message when runtime="acp" and model is provided, guiding users to use runtime="subagent" instead.

Test plan

  • Code compiles and passes lint
  • Reviewer: verify error message is helpful and clear

Fixes #70200

Changed files

  • src/acp/translator.ts (modified, +5/-1)
  • src/agents/tools/sessions-spawn-tool.ts (modified, +7/-0)
  • src/cron/isolated-agent/delivery-dispatch.ts (modified, +20/-1)
  • src/telegram/send.ts (modified, +7/-1)

PR #70210: fix(agent): honor sessions_spawn ACP model overrides

Description (problem / solution / changelog)

Fixes #70200

Summary

  • Problem: sessions_spawn accepted a model parameter, but the ACP runtime branch dropped it before session initialization.
  • Why it matters: callers asking for ACP sessions with an explicit model silently got the agent default instead of the requested model.
  • What changed: ACP spawn now forwards model, initializes ACP sessions with runtimeOptions.model, and persists those options through the existing ACP manager path.
  • What did NOT change (scope boundary): this PR does not add ACP support for thinking; it only fixes model override handling.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #70200
  • Related #70200
  • This PR fixes a bug or regression

Root Cause (if applicable)

  • Root cause: the ACP branch in sessions_spawn read model from tool input but never forwarded it into spawnAcpDirect, and the ACP initialize path had no way to accept initial runtime options.
  • Missing detection / guardrail: ACP spawn tests covered cwd, mode, and resumeSessionId, but not explicit model overrides.
  • Contributing context (if known): ACP already had persisted runtime-options support for per-session config, so this was a wiring gap rather than a missing backend capability.

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file: src/agents/tools/sessions-spawn-tool.test.ts, src/agents/acp-spawn.test.ts, src/acp/control-plane/manager.test.ts
  • Scenario the test should lock in: ACP sessions_spawn with model carries the override through tool dispatch, ACP spawn initialization, and ACP manager runtime-option persistence.
  • Why this is the smallest reliable guardrail: the regression happened across the tool -> spawn -> manager seam, so each handoff now has focused coverage without requiring a live ACP backend.
  • Existing test that already covers this (if any): None.
  • If no new test is added, why not: N/A

User-visible / Behavior Changes

ACP sessions_spawn calls with runtime="acp" now honor explicit model overrides instead of silently falling back to the target agent default model.

Diagram (if applicable)

Before:
sessions_spawn(model=foo, runtime=acp) -> spawnAcpDirect() -> initializeSession() -> agent default model

After:
sessions_spawn(model=foo, runtime=acp) -> spawnAcpDirect(model=foo)
  -> initializeSession(runtimeOptions.model=foo) -> ACP session runs with requested model

Security Impact (required)

  • New permissions/capabilities? (Yes/No) No
  • Secrets/tokens handling changed? (Yes/No) No
  • New/changed network calls? (Yes/No) No
  • Command/tool execution surface changed? (Yes/No) No
  • Data access scope changed? (Yes/No) No
  • If any Yes, explain risk + mitigation:

Repro + Verification

Environment

  • OS: macOS darwin arm64
  • Runtime/container: local source checkout
  • Model/provider: ACP target agents, explicit model override path
  • Integration/channel (if any): ACP session spawn
  • Relevant config (redacted): default local dev config

Steps

  1. Call sessions_spawn with runtime: "acp" and an explicit model.
  2. Observe the ACP child session initialization path.
  3. Verify the requested model is persisted in ACP runtime options and used for the child session.

Expected

  • ACP child sessions honor the requested model override.

Actual

  • Before this change, ACP child sessions silently ignored model and used the target agent default.

Evidence

Attach at least one:

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

  • Verified scenarios: ran targeted tests for the sessions tool, ACP spawn path, and ACP manager path; committed through scripts/committer, which also ran pnpm check:changed --staged.
  • Edge cases checked: ACP model forwarding without thread binding; runtime-option persistence during ACP session initialization.
  • What you did not verify: live ACP backend behavior against a real external harness.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? (Yes/No) Yes
  • Config/env changes? (Yes/No) No
  • Migration needed? (Yes/No) No
  • If yes, exact upgrade steps:

Risks and Mitigations

  • Risk: ACP backends that reject model config options could still fail later when runtime controls apply.
    • Mitigation: this change only restores the documented override path and uses the existing ACP runtime-options/control plumbing that already handles backend capability checks.

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • src/acp/control-plane/manager.core.ts (modified, +4/-1)
  • src/acp/control-plane/manager.test.ts (modified, +71/-0)
  • src/acp/control-plane/manager.types.ts (modified, +1/-0)
  • src/agents/acp-spawn.test.ts (modified, +24/-0)
  • src/agents/acp-spawn.ts (modified, +4/-0)
  • src/agents/tools/sessions-spawn-tool.test.ts (modified, +22/-0)
  • src/agents/tools/sessions-spawn-tool.ts (modified, +1/-0)

Code Example

model: Type.Optional(Type.String()),
// ...
const modelOverride = readStringParam(params, "model");

---

const result = await spawnAcpDirect(
  {
    task,
    label: label || undefined,
    agentId: requestedAgentId,
    resumeSessionId,
    cwd,
    mode: mode === "run" || mode === "session" ? mode : undefined,
    thread,
    sandbox,
    streamTo,
  },
  // ...
);

---

const result = await spawnSubagentDirect({
  // ...
  model: modelOverride,
  // ...
});

---

error: "cron: job execution timed out"
durationMs: 3600000

---

service=acp-session-manager state={"id":"ses_...","model":{"providerID":"opencode","modelID":"big-pickle"}} creating_session
RAW_BUFFERClick to expand / collapse

Bug

sessions_spawn tool declares a model parameter in its schema (src/agents/tools/sessions-spawn-tool.ts:99) and reads it into modelOverride at line 175:

model: Type.Optional(Type.String()),
// ...
const modelOverride = readStringParam(params, "model");

But the ACP runtime branch (lines 246-253) passes params to spawnAcpDirect without forwarding model:

const result = await spawnAcpDirect(
  {
    task,
    label: label || undefined,
    agentId: requestedAgentId,
    resumeSessionId,
    cwd,
    mode: mode === "run" || mode === "session" ? mode : undefined,
    thread,
    sandbox,
    streamTo,
  },
  // ...
);

The SpawnAcpParams type (src/agents/acp-spawn.ts:102-112) has no model field, so this is a structural gap, not just a missed line.

Only the subagent branch (lines 329-335) honors model:

const result = await spawnSubagentDirect({
  // ...
  model: modelOverride,
  // ...
});

Impact

Callers specifying e.g. sessions_spawn({ runtime: "acp", agentId: "opencode", model: "github-copilot/claude-sonnet-4.6" }) see their model choice silently ignored. The downstream agent (OpenCode in my case) then falls back to its own defaultModel() resolver — which in OpenCode's case prefers opencode/big-pickle whenever the built-in opencode provider is registered (effectively always).

For cron-driven ACP sessions this meant the free-tier big-pickle model was used instead of the intended claude-sonnet-4.6, and sessions repeatedly hung for 30 minutes producing zero tokens before timing out. Symptom from my ~/.openclaw/cron/runs/*.jsonl:

error: "cron: job execution timed out"
durationMs: 3600000

OpenCode log confirms the model drift:

service=acp-session-manager state={"id":"ses_...","model":{"providerID":"opencode","modelID":"big-pickle"}} creating_session

Workaround on my side was disabling the opencode provider in OpenCode's config to force its fallback chain past big-pickle. That is a downstream kludge; the real fix belongs here.

Expected

The ACP branch should either:

  1. Forward model into spawnAcpDirectacpManager.initializeSessionclient.newSession, persisting via unstable_setSessionModel if the underlying protocol requires a post-spawn step; or
  2. Reject the call with a clear error when model is set but runtime === "acp".

Silently dropping a documented schema parameter is the worst of the three options.

Reproduction

Any sessions_spawn({ runtime: "acp", agentId: "opencode", model: "<anything>" }). The model value never reaches the child session; check ~/.local/share/opencode/log/*.log for the creating_session line to see which model OpenCode actually picked.

extent analysis

TL;DR

The sessions_spawn tool should forward the model parameter to spawnAcpDirect or reject the call with an error when model is set and runtime is "acp".

Guidance

  • The ACP branch should be updated to forward the model parameter to spawnAcpDirect, similar to the subagent branch.
  • The SpawnAcpParams type should be updated to include a model field to accommodate this change.
  • As a temporary workaround, callers can disable the opencode provider in OpenCode's config to force the fallback chain past big-pickle.
  • To verify the fix, check the OpenCode log for the creating_session line to ensure the intended model is being used.

Example

const result = await spawnAcpDirect(
  {
    task,
    label: label || undefined,
    agentId: requestedAgentId,
    resumeSessionId,
    cwd,
    mode: mode === "run" || mode === "session" ? mode : undefined,
    thread,
    sandbox,
    streamTo,
    model: modelOverride, // Add the model parameter here
  },
  // ...
);

Notes

The current implementation silently drops the model parameter, leading to unexpected behavior. The fix should ensure that the model parameter is properly forwarded or an error is thrown when it is set and runtime is "acp".

Recommendation

Apply a workaround by updating the ACP branch to forward the model parameter to spawnAcpDirect or reject the call with an error when model is set and runtime is "acp", as this will ensure that the intended model is used and prevent silent failures.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix sessions_spawn: model parameter silently dropped on ACP runtime branch [2 pull requests, 1 comments, 2 participants]