Skip to content

acpmux: fix the base compile error from #24739 (images as a slice) - #24813

Merged
teamleaderleo merged 1 commit into
feat-cmux-nextfrom
deputy-2/acpmux-images-slice
Oct 24, 2026
Merged

teamleaderleo merged 1 commit into
feat-cmux-nextfrom
deputy-2/acpmux-images-slice

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes the acpmux base red that #24739 (2584a85) introduced on feat-cmux-next. It hides every acpmux test: Rust MSRV (1.91), clippy, cargo test and the cross-build fail on every acpmux PR (for example #24811, run 40068104184, which changes none of these files).

error[E0308]: mismatched types
   --> crates/acpmux/src/hub/prompt_images.rs:382:67
382 |             msg.get("images").and_then(Value::as_array).unwrap_or(&[]),
    |                                                                   ^^^ expected `&Vec<Value>`, found `&[_; 0]`

The same error is at hub/queue.rs:370 and hub/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_parts takes &[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


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with 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 because unwrap_or expects &Vec<Value> while &[] is a slice literal. The fix maps to a slice first (.map(Vec::as_slice).unwrap_or_default()), matching what inline_parts takes. 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.

View guided diff Turn on auto-fix

`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
@cursor

cursor Bot commented Oct 24, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot 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.

@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 24, 2026 06:11 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review af9f554: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr24813 -f ref=deputy-2/acpmux-images-slice -f platform=macos -f backend_mode=local

red: cmux-next checks (god files, concurrency, crash safety, l10n); base red: the same failure on the base d79dbaa; does not block

@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 24, 2026
@blacksmith-sh

blacksmith-sh Bot commented Oct 24, 2026

Copy link
Copy Markdown

Found 9 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmppbxdofc7/summary-fail.json (live):/summary-fail.json (live): View Logs
/tmp/tmpyl4ymix3/summary-missing.json (live):/summary-missing.json (live): View Logs
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows/
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows
View Logs
[new_workspaces] the window draws no frames/[new_workspaces] the window draws no frames View Logs
[tabs] debug.tab_switch timed 0 of 40 switches/
[tabs] debug.tab_switch timed 0 of 40 switches
View Logs
[tabs] the window draws no frames/[tabs] the window draws no frames View Logs
convention violations found (ERROR lines above)./
convention violations found (ERROR lines above).
View Logs
test_bot_attempt_three_drops_stale_owned_pool_placement (main.PathRoutingStructure.
test_bot_attempt_three_drops_stale_owned_pool_placement)/
test_bot_attempt_three_drops_stale_owned_pool_placement (main.PathRoutingStructure.
test_bot_attempt_three_drops_stale_owned_pool_placement)
View Logs
test_the_session_lane_label_comes_after_the_fork_clause (main.GeneratedFilesRunner.
test_the_session_lane_label_comes_after_the_fork_clause)/
test_the_session_lane_label_comes_after_the_fork_clause (main.GeneratedFilesRunner.
test_the_session_lane_label_comes_after_the_fork_clause)
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Bead cx-34m4y created for this PR by the cmux coordinator.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex xhigh, correctness first): SHIP at af9f554

No findings: Vec::as_slice turns Option<&Vec<Value>> into Option<&[Value]>, and <&[Value]>::default() is &[], so behaviour is unchanged and it type-checks on 1.91. acpmux compiles at this head (build-windows / build acpmux x86_64-pc-windows-gnu is green). Every remaining red is also red on base: web bundles, cmux-next checks, release-notary, Guard status, and clippy (changed cmux-tui packages). The clippy lints are in dispatch.rs, requests.rs and an older if in prompt_images.rs; base hid them behind this compile error, and a follow-up PR fixes them.

@teamleaderleo teamleaderleo added the ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds label Oct 24, 2026
@teamleaderleo
teamleaderleo merged commit a4daae4 into feat-cmux-next Oct 24, 2026
236 of 253 checks passed
@teamleaderleo
teamleaderleo deleted the deputy-2/acpmux-images-slice branch October 24, 2026 06:48
lawrencecchen pushed a commit that referenced this pull request Oct 24, 2026
…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>
@github-actions

Copy link
Copy Markdown
Contributor

Shipped in:

This branch was previously deployed

4 inactive deployments
artifacts — af9f5543 Deployed Oct 24, 2026 by teamleaderleo via add the Windows daemon to the tree #49016
ci-routing-agent — af9f5543 Deployed Oct 24, 2026 by github-actions[bot] via cmux-next macOS placement #33263
sentry-dsyms — af9f5543 Deployed Oct 24, 2026 by teamleaderleo via upload cmux-tui dSYMs to Sentry #49016
cmux-tui-merge-tree — af9f5543 Deployed Oct 24, 2026 by teamleaderleo via publish the merge tree #5480
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant