Skip to content

fix: validate agent session runtimes#171

Merged
bglusman merged 8 commits into
mainfrom
fix-agent-sessions
May 11, 2026
Merged

fix: validate agent session runtimes#171
bglusman merged 8 commits into
mainfrom
fix-agent-sessions

Conversation

@bglusman
Copy link
Copy Markdown
Owner

What changed

  • Treat openclaw-channel as a named-session adapter and include the selected Calciforge session in OpenClaw sessionKey values.
  • Resolve ACPX and subprocess agent commands through the same agent env.PATH used at dispatch time.
  • Make !new and session-bearing !switch fail before persisting state when the active runtime cannot actually spawn the configured tool.
  • Extend doctor to report missing subprocess runtime commands, including Docker/container mismatches.
  • Document the Docker/runtime boundary for CLI-backed agents and require a post-update doctor run in the Compose path.

Root cause

The 210 WhatsApp failures were caused by a runtime mismatch: acpx, opencode, kilo, and claude existed on the host, but not inside the running Calciforge container where the ACPX adapter was spawned. doctor did not validate that mismatch, and !new could report success even though the next dispatch would fail with os error 2.

Validation

  • cargo fmt --check
  • cargo clippy -p calciforge --all-targets -- -D warnings
  • cargo test -p calciforge new_session
  • cargo test -p calciforge switch_records
  • cargo test -p calciforge switch_with_session_reports_missing_runtime
  • cargo test -p calciforge check_agent_wiring_reports_missing
  • cargo test -p calciforge test_dispatch_uses_selected_downstream_session_in_session_key
  • scripts/check-packaging.sh
  • Push hook full unit/doc/loom checks passed

Copilot AI review requested due to automatic review settings May 11, 2026 17:21
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens subprocess-agent session handling by validating that the configured runtime can actually spawn the required binaries (especially in Docker/Compose deployments), and extends session semantics for openclaw-channel to include the selected Calciforge session in OpenClaw sessionKey values.

Changes:

  • Add shared, env.PATH-aware executable resolution and extend doctor to report missing subprocess runtime commands (including acpx + downstream client commands).
  • Make !new and session-capable !switch fail fast (before persisting state) when the selected agent runtime cannot be spawned.
  • Treat openclaw-channel as session-capable and append the selected Calciforge session name to OpenClaw sessionKey; update Docker/packaging docs to emphasize running doctor inside the container.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
scripts/check-packaging.sh Adjust YAML validation approach for packaging workflow files.
packaging/docker/README.md Add Compose instructions to run calciforge doctor --no-network inside the container; document runtime boundary for CLI-backed agents.
docs/packaging.md Add Compose post-start doctor step and clarify that CLI agent binaries must exist inside the container runtime.
docs/codex-openclaw-integration.md Document session-bearing sessionKey format for openclaw-channel.
docs/agents.md Document session lane behavior and note runtime requirements for subprocess-backed agents in Docker.
crates/calciforge/src/doctor.rs Add subprocess runtime dependency checks (acpx + client command resolution via env.PATH).
crates/calciforge/src/commands.rs Preflight runtime readiness for !new / !switch and run acpx discovery via the same env.PATH used at dispatch time.
crates/calciforge/src/channels/telegram.rs Update inline comments to reflect “downstream sessions” terminology.
crates/calciforge/src/adapters/openclaw_channel.rs Append selected session to OpenClaw sessionKey and add a test covering the behavior.
crates/calciforge/src/adapters/mod.rs Introduce shared helpers for resolving executables and per-kind subprocess commands.
crates/calciforge/src/adapters/acpx.rs Resolve the acpx binary via the shared PATH-aware helper.

Comment thread crates/calciforge/src/adapters/mod.rs Outdated
Comment thread crates/calciforge/src/commands.rs
@bglusman bglusman marked this pull request as ready for review May 11, 2026 20:02
@qodo-code-review
Copy link
Copy Markdown

ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one.

Copilot AI review requested due to automatic review settings May 11, 2026 21:21
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Comment thread crates/calciforge/src/adapters/mod.rs Outdated
Comment thread crates/calciforge/src/commands.rs Outdated
Comment thread crates/calciforge/src/adapters/openclaw_channel.rs
Copilot AI review requested due to automatic review settings May 11, 2026 21:35
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Comment thread crates/calciforge/src/commands.rs
Comment thread crates/calciforge/src/commands.rs Outdated
Copilot AI review requested due to automatic review settings May 11, 2026 21:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

.collect::<Vec<_>>()
.join("; ");
report.error(format!(
"agent '{}' openclaw-channel model route is incompatible with runtime '{}': {}; fix agents.defaults.model or agents.defaults.agentRuntime before deployment",
@bglusman bglusman merged commit ce43993 into main May 11, 2026
26 checks passed
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.

2 participants