Skip to content

fix(cron): log why a shell job could not run; give the cron e2e host storage - #8364

Merged
senamakel merged 3 commits into
tinyhumansai:mainfrom
M3gA-Mind:fix/cron-e2e-host-storage-and-shell-warn
Oct 24, 2026
Merged

senamakel merged 3 commits into
tinyhumansai:mainfrom
M3gA-Mind:fix/cron-e2e-host-storage-and-shell-warn

Conversation

@M3gA-Mind

@M3gA-Mind M3gA-Mind commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Stacked on #8361 (fix/raw-coverage-build-on-main, by W2), which makes the openhuman-cli raw_coverage_all target compile. Until #8361 merges, this PR's diff also shows #8361's commits. This PR's own change is the last commit, c680d09: 3 files, +19 −2.

Fixes automation_scheduling_e2e::cron_run_records_history_and_remove_is_not_idempotent. Once the target compiles, it fails even when run CI-faithfully (test modules installed, full product features, one module per process). The shell job's run record is status: "error", output: "Command execution is unavailable.".

Root cause, from a traced run on the CI host.

  1. A cron shell job runs through the TinyBox module (sandbox::shell_exec::run_owned → tinybox::create, passthrough backend).
  2. Before creating the command resource, TinyBox asks host storage for its capabilities: [storage_host] module storage call module=tinybox … op=Capabilities outcome="no-backend". It treats that as fatal (reason="module_fault"), so create fails with "MODULE_CALL_REPORTED: module execution failed".
  3. no-backend happens because nothing installed a process storage backend. A real host's boot fills the slot (openhuman-rpc server/shims.rs → session_store::install_for_host). This suite builds the router directly and boots no host. The suite crate already provides HostStorage for exactly this, documented as "modules reach host storage only through the installed backend … these suites boot none", and the composio suites use it. The cron test did not.

Fix

  • The cron test installs crate::HostStorage under its env lock.
  • Observability: both places that swallowed the cause now log it at warn.
    • cron/scheduler/shell_job.rs logs the run_host error with the job id. The recorded output stays "Command execution is unavailable.".
    • sandbox/shell_exec.rs logs the module's error from the TinyBox create call.

Before this, neither a user nor CI could tell why a cron shell job failed.

Tests

On the CI host, CI-faithful, --test raw_coverage_all -- automation_scheduling_e2e::… --test-threads=1:

Summary by CodeRabbit

  • Bug Fixes
    • Added warning and error details to logs when shell command execution or resource setup fails. The existing error messages remain unchanged.
  • Tests
    • Updated automated tests for storage, scheduled shell jobs, and inference controllers to use current test interfaces and configurations.

…ontroller registry

Main removed the `openhuman_core::storage::MemoryStorage` re-export, and
`core::all::all_registered_controllers` now returns `ControllerEntry`s, so
`raw_coverage_all` (and `inbound_linked_e2e`) stopped compiling:

- E0433 tests/raw_coverage_all.rs:61, tests/inbound_linked_e2e.rs:51: install
  the testkit `MemoryBackend` the core's own tests use, via a new
  `tinystoragedrivers-testkit` dev-dependency of openhuman-cli (same rev).
- E0308 tests/raw_coverage/inference_local_controllers_rpc_e2e.rs:219,473:
  look up and invoke core-registry entries through `ControllerEntry::invoke`.
…storage

A cron shell job runs through the TinyBox module, which asks host storage
for its capabilities before creating the command resource. The
raw_coverage cron e2e boots no host, so no storage backend was installed,
the storage host answered "no-backend", TinyBox reported a module fault,
and the job recorded "Command execution is unavailable." Install the
suite's HostStorage for that test, as the composio suites already do.

Both places that swallowed the cause now log it: the cron shell job
(`run_host` error, with the job id; the recorded output is unchanged) and
the TinyBox create call in sandbox::shell_exec.
@tinysweeper

tinysweeper Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Reviewed head: c680d09311447c57aaea7a28f3414faeca087183

Findings

No active actionable findings.

Advisory notes

  • medium: Mention that the diff swaps in a new testkit storage dependency ((pull request description))
    Problem: The PR body says the change is "3 files, +19 −2" and describes only two `tracing::warn!` additions plus a storage install in the cron test. The diff actually does much more:
    Suggested fix:
    No concrete fix was supplied.

Verdict: Ready for maintainer review · Priority: medium
Coverage: Reviewed 7 of 8 files; not reviewed: Cargo.lock.

Diagnostics and supporting details

Full summary

Pull request purpose (title): fix(cron): log why a shell job could not run; give the cron e2e host storage. Tiny Sweeper completed its review; deterministic results follow.

Unreviewed paths

  • Cargo.lock

Review snapshot

Change surface Files Review signal Count
Production 2 Active findings 0
Tests 4 Noted findings 1
Documentation 0 Resolved findings 0
Configuration 1 Pending checks/questions 0

Completeness: Complete
Test assessment: No supported feature-to-test mapping was available; this does not mean tests are absent or passed.

What changed

Behaviorally, the cron shell-job path and sandbox shell path now emit `tracing::warn!` diagnostics when they previously discarded the underlying error: `run_job_command_with_timeout` in `crates/openhuman-core/src/cron/scheduler/shell_job.rs#pub(super) async fn run_job_command_with_timeout(` logs the `run_host` error with the job id while still returning "Command execution is unavailable.", and `run_owned` in `crates/openhuman-core/src/sandbox/shell_exec.rs#async fn run_owned(` logs the TinyBox `create` error before mapping it to the same anyhow message.

Features

  • Modified — Warn-level diagnostics when a cron shell job cannot run: Previously the underlying `run_host` error was silently discarded and only "Command execution is unavailable." was recorded; now the error is logged with the job id via `tracing::warn!`, while the user-visible recorded output is unchanged. (crates/openhuman-core/src/cron/scheduler/shell_job.rs pub(super) async fn run_job_command_with_timeout()
  • Modified — Warn-level diagnostics when TinyBox refuses to create a command resource: The error from the TinyBox `create` call is now logged before being mapped to the same anyhow error, surfacing the cause of `module_fault` failures that were previously opaque. (crates/openhuman-core/src/sandbox/shell_exec.rs async fn run_owned()
  • Modified — Test storage backend swapped to tinystoragedrivers_testkit::MemoryBackend: Test harnesses now install `MemoryBackend` instead of `openhuman_core::storage::MemoryStorage`, with a new git dependency declared in the CLI manifest. (tests/raw_coverage_all.rs pub struct HostStorage<'lock>(std::marker::PhantomData<&'lock ()>);, tests/inbound_linked_e2e.rs async fn linked_tinyeventqueues_queues_dedupes_and_delivers_a_composio_trigger(), crates/openhuman-cli/Cargo.toml tinyinference-llm = { path = "../../vendor/tinyagents/vendor/tinyinference/crate)

Tests

No supported feature-to-test mapping was produced. Test execution is not inferred.

Before merge

None.

Agent review details

critique

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The critique lane is Answered and reports reviewing 7 files with 0 findings.
  • Lane summary: Reviewed 7 files; 0 findings. _The code index is behind this pull request (indexed at `d1124cc18c4d`), so retrieved context may be out of date._

security

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The security lane is Answered and reports reviewing 7 files with 0 findings.
  • Lane summary: Reviewed 7 files; 0 findings. _The code index is behind this pull request (indexed at `d1124cc18c4d`), so retrieved context may be out of date._

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The tests lane is Answered with 0 findings and raised one caveat rather than a finding: whether `tinystoragedrivers-testkit` is visible to the `openhuman-cli` integration-test targets, since the manifest declares it unconditionally rather than under `[dev-dependencies]`.
  • Lane summary: The change is diagnostic logging in two error arms plus test-only plumbing (swapping the test storage backend and adapting host-side tests to `ControllerEntry`), and the diff shows no behavioural regression, so nothing here needs a new test. One thing I could not verify: whether `tinystoragedrivers-testkit` is actually visible to the `openhuman-cli` integration-test targets that now call `tinystoragedrivers_testkit::MemoryBackend`, since `Cargo.toml` declares it unconditionally rather than under `[dev-dependencies]`; consult the manifest in-tree before merging. _The code index is behind this pull request (indexed at `d1124cc18c4d`), so retrieved context may be out of date._

commits

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The commits lane is Answered and reports no sensitive content in committed files.
  • Lane summary: No sensitive content in committed files. _The code index is behind this pull request (indexed at `d1124cc18c4d`), so retrieved context may be out of date._

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The description lane further reports that the body presents the tests' `+19 −2` scope as if it were the whole diff, which it states is wrong, and that the unmentioned changes are significant and unrelated to the stated observability fix.
  • Lane summary: The description is accurate about the last commit's intent — logging the swallowed error in `shell_job.rs` and `shell_exec.rs` — and about the cron test's storage install, but it never mentions that the diff also rewrites `tests/inbound_linked_e2e.rs` and `tests/raw_coverage_all.rs` to use `tinystoragedrivers_testkit::MemoryBackend` instead of `openhuman_core::storage::MemoryStorage` (adding that git dependency to `crates/openhuman-cli/Cargo.toml`), nor the substantial refactor of `tests/raw_coverage/inference_local_controllers_rpc_e2e.rs` to call controllers through `ControllerEntry`. Those changes are significant and unrelated to the stated observability fix, and the body also presents the tests' `+19 −2` scope as if that were the whole diff, which is wrong. _The code index is behind this pull request (indexed at `d1124cc18c4d`), so retrieved context may be out of date._
Evidence and run details
  • Models: ladder/vectors-oai3, deepseek-v4.1-flash
  • Spend: $0.001704
  • Tokens: 529637 input · 9415 output · 100376 cached · 409 embedding
  • Updated: 2026-10-24T02:41:31Z
Head State Pass summary
c680d0931144 ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 2026-10-24T02:41:31Z)

tinysweeper 0.1.2

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T02:44:51.817031Z c680d09 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 354747bd-ea6e-402c-af1a-f5eef9d79f0e
Commits

Reviewing files that changed from the base of the PR and between b92d845 and c680d09.

Files ignored due to path filters: 1
  • Cargo.lock is excluded by !**/*.lock
Files selected for processing: 7
  • crates/openhuman-cli/Cargo.toml
  • crates/openhuman-core/src/cron/scheduler/shell_job.rs
  • crates/openhuman-core/src/sandbox/shell_exec.rs
  • tests/inbound_linked_e2e.rs
  • tests/raw_coverage/automation_scheduling_e2e.rs
  • tests/raw_coverage/inference_local_controllers_rpc_e2e.rs
  • tests/raw_coverage_all.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Walkthrough

The scheduler and shell execution code now log details for selected failures. Integration tests update storage backend setup and use ControllerEntry for core registry controller calls.

Changes: Runtime diagnostics

Layer / File(s) Summary
Log command and resource creation failures
crates/openhuman-core/src/cron/scheduler/shell_job.rs, crates/openhuman-core/src/sandbox/shell_exec.rs
The scheduler logs the job ID and formatted error when command execution fails. Shell execution logs the underlying error when TinyBox resource creation fails. Both paths retain their existing generic errors.

Integration test updates

Layer / File(s) Summary
Install testkit storage backends
crates/openhuman-cli/Cargo.toml, tests/inbound_linked_e2e.rs, tests/raw_coverage_all.rs, tests/raw_coverage/automation_scheduling_e2e.rs
The CLI manifest adds the testkit dev-dependency. Tests install MemoryBackend instead of MemoryStorage; the cron test installs HostStorage under the shared environment lock.
Invoke core controllers through registry entries
tests/raw_coverage/inference_local_controllers_rpc_e2e.rs
Core registry tests look up controllers as ControllerEntry values and invoke them through the added helper. Local-runtime controller tests continue to use RegisteredController.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related issues

Possibly related PRs

Suggested reviewers: senamakel

Merge Risk: Minimal · up to c680d

The changes preserve runtime behavior while improving diagnostics and aligning integration tests with current storage and controller APIs.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 45.45% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 6 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the main changes: it adds logging for failed cron shell jobs and configures host storage for the cron end-to-end test.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 45.45% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 6 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the logs at night,
And sees the errors written right.
Test backends settle in their place,
Registry calls run at a steady pace.
The rabbit hops, content and bright.

Comment @coderabbitai help to get the list of available commands.

@tinysweeper tinysweeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

tinysweeper found nothing blocking. Approving.

Diagnostics

Total spend: $0.0017

@tinysweeper tinysweeper Bot added the priority: p2 Soon. Real but survivable — a rough edge, a gap, a thing that will bite later. label Oct 24, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 24, 2026
@M3gA-Mind
M3gA-Mind dismissed coderabbitai[bot]’s stale review October 24, 2026 06:51

The merge-base changed after approval.

@senamakel
senamakel merged commit 647b059 into tinyhumansai:main Oct 24, 2026
25 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p2 Soon. Real but survivable — a rough edge, a gap, a thing that will bite later.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants