fix: validate agent session runtimes#171
Merged
Merged
Conversation
There was a problem hiding this comment.
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
doctorto report missing subprocess runtime commands (includingacpx+ downstream client commands). - Make
!newand session-capable!switchfail fast (before persisting state) when the selected agent runtime cannot be spawned. - Treat
openclaw-channelas session-capable and append the selected Calciforge session name to OpenClawsessionKey; update Docker/packaging docs to emphasize runningdoctorinside 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. |
ⓘ 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. |
| .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", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
openclaw-channelas a named-session adapter and include the selected Calciforge session in OpenClawsessionKeyvalues.env.PATHused at dispatch time.!newand session-bearing!switchfail before persisting state when the active runtime cannot actually spawn the configured tool.doctorto report missing subprocess runtime commands, including Docker/container mismatches.Root cause
The 210 WhatsApp failures were caused by a runtime mismatch:
acpx,opencode,kilo, andclaudeexisted on the host, but not inside the running Calciforge container where the ACPX adapter was spawned.doctordid not validate that mismatch, and!newcould report success even though the next dispatch would fail withos error 2.Validation
cargo fmt --checkcargo clippy -p calciforge --all-targets -- -D warningscargo test -p calciforge new_sessioncargo test -p calciforge switch_recordscargo test -p calciforge switch_with_session_reports_missing_runtimecargo test -p calciforge check_agent_wiring_reports_missingcargo test -p calciforge test_dispatch_uses_selected_downstream_session_in_session_keyscripts/check-packaging.sh