Conversation
Apple Container changed inspect status from a scalar in pre-1.x releases to a nested state object in 1.x. Lifecycle checks still searched minified JSON for the scalar form, while list rendering only handled the nested form, so either runtime could be misclassified.\n\nDecode both schemas through one typed parser and use the resulting run-state enum for readiness, inspection, failed-removal classification, and list output. Add regression coverage for both schemas, formatting differences, terminal states, and malformed output.\n\nFixes #1185
Greptile SummaryThe PR replaces brittle Apple Container status substring checks with a typed decoder shared across readiness, lifecycle inspection, removal handling, and container listing.
Confidence Score: 5/5The PR appears safe to merge, with no concrete changed-code failure established. The shared decoder handles both status schemas described by the change, its callers consistently interpret the resulting states, and the added tests cover the relevant successful, stopped, exited, unknown, empty, and malformed cases.
|
| Filename | Overview |
|---|---|
| crates/tools/src/sandbox/containers.rs | Introduces the shared typed status decoder and applies it consistently to listing, removal classification, and inspect parsing without an established defect. |
| crates/tools/src/sandbox/apple.rs | Updates readiness and lifecycle inspection to consume typed running, stopped, and exited states. |
| crates/tools/src/sandbox/tests/apple.rs | Adds focused regression tests for legacy and current status schemas, malformed output, missing fields, and unknown states. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
CLI["Apple Container JSON output"] --> Decoder["Shared typed status decoder"]
Decoder --> Legacy["Legacy: status = running"]
Decoder --> Current["Current: status.state = running"]
Legacy --> State["ContainerRunState"]
Current --> State
State --> Ready["Readiness polling"]
State --> Inspect["Lifecycle inspection"]
State --> Remove["Removal classification"]
State --> List["Container listing"]
Reviews (1): Last reviewed commit: "fix(sandbox): parse Apple Container stat..." | Re-trigger Greptile
Merging this PR will improve performance by 10.19%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | session_history_path[2026-02-09T12:00:00Z] |
7.9 µs | 7.2 µs | +10.19% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing cat-mambo (5a2ca90) with main (d739b6f)
Footnotes
-
9 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
statusvalues and 1.x nestedstatus.statevaluesFixes #1185.
Validation
Completed
cargo test -p moltis-tools sandbox::tests::apple -- --nocapture./scripts/check-file-size.shjust release-preflightRemaining
./scripts/local-validate.sh <PR_NUMBER>Manual QA
[tools.exec.sandbox]withbackend = "apple-container"andmode = "all".pwdusing Apple Container 1.x and confirm the container reaches exec-ready state without being removed and recreated.statusoutput remains supported.