fix(acp): make send_error available in release builds#493
Merged
Conversation
The thread goal handler added in #491 calls self.send_error() in a non-debug code path, but send_error was gated behind #[cfg(debug_assertions)], so it was compiled out of release builds. CI never caught this because every check builds and tests with the ci-test profile (which inherits from `test`, debug-assertions on), so the method exists there. Only `cargo build --release` in the release workflow compiles with debug-assertions off, where the method is absent and the call fails to compile with E0599. Remove the cfg gate so send_error exists in all builds. 🤖 Generated with [Nori](https://noriagentic.com) Co-Authored-By: Nori <contact@tilework.tech>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The release build on
mainis failing to compile while branch checks and the main check pass. Run that surfaced it: https://github.com/tilework-tech/nori-cli/actions/runs/26769466753Root cause:
thread_goal.rs, which callsself.send_error(&message)atthread_goal.rs:392in a non-debug code path (a real user-facing validation error: "goal update must include an objective or status").send_error(submit_and_ops.rs:298) was gated behind#[cfg(debug_assertions)]— it was originally only called from a debug-gated branch, so the method itself was debug-only.rust-ci.yml, branch checks, main check) builds and tests with--profile ci-test, whichinherits = "test"→ debug-assertions on → the method exists.cargo build --release(nori-release.yml:365).[profile.release]leaves debug-assertions at its default of off → the method is compiled out →E0599: no method named send_error.Fix: remove the
#[cfg(debug_assertions)]gate sosend_errorexists in all builds. The error event it emits is a legitimate user-facing path in release, so it should not be compiled out. The remaining debug-only caller (submit_and_ops.rs:257, unknown-op diagnostic) stays debug-gated and is unaffected; the method is still used in release via the thread goal handler, so there is no dead-code warning.Test plan
cargo check --release -p nori-acp→E0599atthread_goal.rs:392.cargo check --release -p nori-acpcompiles cleanly.