Skip to content

Retain native shell timeout outcomes and offload preparation - #58

Merged
senamakel merged 7 commits into
tinybox-shell-selection-7391from
tinybox-native-shell-7391
Oct 11, 2026
Merged

senamakel merged 7 commits into
tinybox-shell-selection-7391from
tinybox-native-shell-7391

Conversation

@senamakel

Copy link
Copy Markdown
Member

Native shell timeouts could become BackendFailed when kill/reap initially failed and cleanup succeeded on a later retry. Retain the timeout outcome until cleanup is acknowledged. Native shell preparation now runs on a blocking worker so slow filesystem operations do not stall the module's sole async worker.

These address the two review findings posted on #53 while another actor merged it at e95d96a. The fixes were pushed afterward and therefore require this follow-up. Stacked on #52's branch; preserve all commits.

Public API changes: None.

Validation:

  • The timeout regression first failed with BackendFailed instead of TimedOut; it now passes and verifies failed retries retain ownership.
  • The current-thread preparation regression first failed because filesystem setup ran on the async worker; it now passes.
  • cargo fmt --all -- --check: passed.
  • cargo clippy --all-targets --all-features -- -D warnings: passed.
  • cargo build --all-targets --all-features: passed.
  • cargo test --all-features: passed.
  • Hosted checks are running on fa3f11d.

senamakel and others added 7 commits October 11, 2026 23:07
Add a regression test asserting that a timed-out execution keeps its
TimedOut status once cleanup is retried and acknowledged, rather than
being masked by the earlier CleanupFailed state. The remote fixture
hosts gain a wait_for_timeout flag so the test can hold cleanup pending
until the timeout fires.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The DockerFaultHost fixture no longer blocks on a pending future when
wait_for_timeout is set, since the flag was never exercised by the
stream tests.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Stream executions that hit their timeout were reported as backend failures
because the timeout branch never recorded why the run ended. A flag is now
set when the timeout elapses and consulted when the journal is finished, so
callers see ExecutionFailure::TimedOut instead of a generic backend error.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Document that a pending timeout outcome survives until a later cleanup retry succeeds, making the retry semantics of the native shell execution spec explicit.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Shell scratch preparation now runs on a blocking thread instead of the
sole async worker, so filesystem work no longer stalls the runtime.
Added a test asserting preparation happens on a different thread.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Filesystem preparation now runs via spawn_blocking so slow storage cannot stall the module runtime, with worker failures mapped to a backend error. The spec was updated to document that preparation and recursive cleanup happen on blocking workers.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…ecution

The execution support check now runs inside prepare_execution instead of
after the resource lookup, so unsupported providers are rejected before
any collector or execution state is set up.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@coderabbitai

coderabbitai Bot commented Oct 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4bc17e6f-3c87-4a6a-a52e-5f08dc961557

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

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

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 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-11T20:15:07.363218Z fa3f11d 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.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fa3f11deb3

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +319 to +322
let failure = if self.timed_out.load(std::sync::atomic::Ordering::SeqCst) {
ExecutionFailure::TimedOut
} else {
ExecutionFailure::BackendFailed

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve cancellation precedence after cleanup retry

When cancellation is requested before the shell deadline but the runner ignores it until the timeout and the first drain fails, the task records CleanupFailed; after a later drain succeeds, this branch reports TimedOut solely because the deadline also elapsed. That conflicts with the normal completion path above, where cancel_requested() takes precedence over result.is_none() and produces Cancelled. Retain the intended terminal outcome at timeout/cleanup failure so retrying cleanup does not change a cancelled execution into a timeout.

Useful? React with 👍 / 👎.

@senamakel
senamakel merged commit b511bb7 into tinybox-shell-selection-7391 Oct 11, 2026
13 of 15 checks passed
@tinysweeper

tinysweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

⚠️ Review failed for fa3f11deb3d7. the review of #58 did not finish within 900s

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.

1 participant