Repository navigation
acpmux: fix the base compile error from #24739 (images as a slice) - #24813
Conversation
`msg.get("images").and_then(Value::as_array).unwrap_or(&[])` does not
type-check: `unwrap_or` wants a `&Vec<Value>`, and `&[]` is a `&[_; 0]`
(E0308 at hub/prompt_images.rs:382, hub/queue.rs:370,
hub/queue_edit.rs:188). Map to a slice first, which is what
`inline_parts` takes, and default to the empty slice. The behaviour is
the same: no images means an empty list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a1603a-6462-72f0-a4b0-6937eb58e4c3&host=cosmic-gray
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
red: cmux-next checks (god files, concurrency, crash safety, l10n); base red: the same failure on the base d79dbaa; does not block |
|
Found 9 test failures on Blacksmith runners: Failures
|
|
Bead |
|
Review (codex xhigh, correctness first): SHIP at af9f554 No findings: |
…24813) `msg.get("images").and_then(Value::as_array).unwrap_or(&[])` does not type-check: `unwrap_or` wants a `&Vec<Value>`, and `&[]` is a `&[_; 0]` (E0308 at hub/prompt_images.rs:382, hub/queue.rs:370, hub/queue_edit.rs:188). Map to a slice first, which is what `inline_parts` takes, and default to the empty slice. The behaviour is the same: no images means an empty list. Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a1603a-6462-72f0-a4b0-6937eb58e4c3&host=cosmic-gray Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
Shipped in:
|
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Fixes the acpmux base red that #24739 (2584a85) introduced on
feat-cmux-next. It hides every acpmux test:Rust MSRV (1.91), clippy,cargo testand the cross-build fail on every acpmux PR (for example #24811, run 40068104184, which changes none of these files).The same error is at
hub/queue.rs:370andhub/queue_edit.rs:188.Change. At all three sites,
.and_then(Value::as_array).unwrap_or(&[])becomes.and_then(Value::as_array).map(Vec::as_slice).unwrap_or_default().inline_partstakes&[Value], and no images is still an empty slice, so behaviour doesn't change. It's 3 lines. rustfmt (edition 2024) is clean, and CI's Rust jobs on this PR are the compile check.Risk. Low. It's a type-level fix with no behaviour change.
Agent session: cosmic-gray
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Fixes the acpmux compile error that #24739 introduced on
feat-cmux-next, which was breaking Rust MSRV, clippy, cargo test, and cross-build checks on every acpmux PR. At three sites,.and_then(Value::as_array).unwrap_or(&[])didn't type-check becauseunwrap_orexpects&Vec<Value>while&[]is a slice literal. The fix maps to a slice first (.map(Vec::as_slice).unwrap_or_default()), matching whatinline_partstakes. This is a type-level fix only—no images still means an empty slice, so behavior is unchanged.Written for commit af9f554. Summary will update on new commits.