Skip to content

fix(core): satisfy non-exhaustive AcpTransport match without acp-http#5628

Merged
bug-ops merged 2 commits into
mainfrom
fix/5623-acp-transport-match
Jul 3, 2026
Merged

fix(core): satisfy non-exhaustive AcpTransport match without acp-http#5628
bug-ops merged 2 commits into
mainfrom
fix/5623-acp-transport-match

Conversation

@bug-ops

@bug-ops bug-ops commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #5623. run_configured_acp_autostart (src/runner.rs) matches on AcpTransport, which is marked non-exhaustive and defined outside this crate (zeph-config) — so rustc requires an unconditional wildcard arm regardless of local variant coverage. The only wildcard arm present was itself feature-gated to acp-http, leaving no catch-all when that feature was disabled. Building with acp enabled and acp-http disabled therefore failed to compile with E0004, a combination invisible to CI since the ide bundle always pairs the two features together.

Replaces the feature-gated wildcard with a single unconditional arm that warns and falls back to stdio. Stdio, Http, and Both remain fully handled by existing explicit arms under every feature combination — the new arm only ever reaches a variant unknown to this build. Adversarial review confirmed this fallback is effectively unreachable today: an unrecognized transport value in config fails at serde deserialization before ever reaching this match, so warn+fallback is a safe, zero-cost safety net rather than a behavior that could mask a real misconfiguration in practice.

Review process

developer (read the full match block and AcpTransport's definition before restructuring) → parallel (tester independently reproduced the original E0004 via a real revert-and-recheck rather than trusting the report, confirmed no unreachable-pattern overlap between the two wildcard-adjacent arms; adversarial critic verified the new arm is genuinely unreachable under every currently-compilable feature combination, confirmed no other latent instance of this pattern elsewhere in the codebase) → code reviewer (independently re-verified both feature combinations compile, full CI suite, approved).

Test plan

  • cargo +nightly fmt --check
  • cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings
  • cargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins — 11973 passed, 0 failed
  • rustdoc gate (RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler")
  • cargo check --features "acp,session,scheduler" (the broken combination from the issue) — now compiles clean, independently reproduced as broken beforehand via a real revert
  • cargo check --features "ide,session,scheduler" (acp+acp-http) — still compiles clean, no regression
  • No dedicated unit test added: a #[non_exhaustive] missing-wildcard-arm bug is a compile-time-only defect not constructible/triggerable at runtime from outside the defining crate — the two cargo check invocations above are the real and sufficient regression guard, matching agreement from both the tester and reviewer
  • Live-testing playbook and coverage-status updated in .local/testing/ (main repo) per project convention

@github-actions github-actions Bot added bug Something isn't working size/S Small PR (11-50 lines) documentation Improvements or additions to documentation and removed size/S Small PR (11-50 lines) labels Jul 3, 2026
@bug-ops bug-ops enabled auto-merge (squash) July 3, 2026 22:26
@bug-ops bug-ops force-pushed the fix/5623-acp-transport-match branch from 94d9b7c to 08497d9 Compare July 3, 2026 22:26
@github-actions github-actions Bot added the size/S Small PR (11-50 lines) label Jul 3, 2026
bug-ops added a commit that referenced this pull request Jul 3, 2026
…pervisor

The test relied on a single tokio::task::yield_now() to observe a spawned
subagent task in the TaskSupervisor snapshot before it completed and was
reaped. RunOnce entries are removed from supervisor state in the same lock
update that marks them Completed, so under CI scheduling pressure the
near-instant mock provider response could finish and get reaped before the
single yield resumed the test, leaving the snapshot empty (observed on
PR #5628, shard 5/8). Use a MockProvider with an explicit response delay so
the task is deterministically still Running when the snapshot is taken.
@github-actions github-actions Bot added the rust Rust code changes label Jul 3, 2026
bug-ops added a commit that referenced this pull request Jul 3, 2026
…pervisor

The test relied on a single tokio::task::yield_now() to observe a spawned
subagent task in the TaskSupervisor snapshot before it completed and was
reaped. RunOnce entries are removed from supervisor state in the same lock
update that marks them Completed, so under CI scheduling pressure the
near-instant mock provider response could finish and get reaped before the
single yield resumed the test, leaving the snapshot empty (observed on
PR #5628, shard 5/8). Use a MockProvider with an explicit response delay so
the task is deterministically still Running when the snapshot is taken.
@bug-ops bug-ops force-pushed the fix/5623-acp-transport-match branch from 9a5f44d to 33939f2 Compare July 3, 2026 23:05
bug-ops added 2 commits July 4, 2026 01:15
run_configured_acp_autostart matches AcpTransport, which is marked
non-exhaustive and defined outside this crate, so rustc requires an
unconditional wildcard arm regardless of local variant coverage. The
only wildcard arm present was itself feature-gated to acp-http,
leaving no catch-all when that feature was disabled, so acp without
acp-http failed to compile with E0004.

Replaces it with a single unconditional wildcard arm that warns and
falls back to stdio. Stdio, Http, and Both remain fully handled by
existing explicit arms under every feature combination, so the new
arm only ever reaches a variant unknown to this build.

Closes #5623
…pervisor

The test relied on a single tokio::task::yield_now() to observe a spawned
subagent task in the TaskSupervisor snapshot before it completed and was
reaped. RunOnce entries are removed from supervisor state in the same lock
update that marks them Completed, so under CI scheduling pressure the
near-instant mock provider response could finish and get reaped before the
single yield resumed the test, leaving the snapshot empty (observed on
PR #5628, shard 5/8). Use a MockProvider with an explicit response delay so
the task is deterministically still Running when the snapshot is taken.
@bug-ops bug-ops force-pushed the fix/5623-acp-transport-match branch from 33939f2 to 06fb971 Compare July 3, 2026 23:21
@bug-ops bug-ops merged commit 4bdaae3 into main Jul 3, 2026
37 checks passed
@bug-ops bug-ops deleted the fix/5623-acp-transport-match branch July 3, 2026 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation rust Rust code changes size/S Small PR (11-50 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

run_configured_acp_autostart: non-exhaustive AcpTransport match fails to compile without acp-http feature

1 participant