Skip to content

Fix CI failures from random crate trait resolution#183

Open
Jeshua Ben Joseph (Theaxiom) wants to merge 4 commits intomainfrom
test/security-api-integration-6330113580195656149
Open

Fix CI failures from random crate trait resolution#183
Jeshua Ben Joseph (Theaxiom) wants to merge 4 commits intomainfrom
test/security-api-integration-6330113580195656149

Conversation

@Theaxiom
Copy link
Copy Markdown
Member

  • Downgrade rand crate to 0.8 in root Cargo.toml to match rand_core compatibility expectations
  • Remove the explicit rand_core = { workspace = true } override from shared/Cargo.toml
  • Adjust shared/src/crypto.rs implementations of X25519-dalek to explicitly use chacha20poly1305::aead::OsRng rather than the rand crate functions, bypassing mismatched CryptoRng trait versions entirely.
  • Resolve missing tokio::time functions under cargo test by enabling the test-util feature in the root Cargo.toml.

- Downgrade `rand` crate to 0.8 in root Cargo.toml to match rand_core compatibility expectations
- Remove the explicit `rand_core = { workspace = true }` override from `shared/Cargo.toml`
- Adjust `shared/src/crypto.rs` implementations of X25519-dalek to explicitly use `chacha20poly1305::aead::OsRng` rather than the `rand` crate functions, bypassing mismatched `CryptoRng` trait versions entirely.
- Resolve missing `tokio::time` functions under `cargo test` by enabling the `test-util` feature in the root Cargo.toml.

Co-authored-by: Theaxiom <57013+Theaxiom@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 30, 2026 00:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR targets CI failures caused by Rust dependency/trait-version mismatches (notably around RNG traits) and missing Tokio test time controls, with a couple of accompanying coordinator Python packaging/test formatting updates.

Changes:

  • Switch shared crypto RNG usage to chacha20poly1305::aead::OsRng and align rand_core usage to avoid CryptoRng trait version conflicts.
  • Enable Tokio test-util feature and pin hkdf to an older compatible version to stabilize builds/tests.
  • Add coordinator Poetry lockfile and adjust a unit test assertion formatting.

Reviewed changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
shared/src/crypto.rs Replaces rand RNG usage with OsRng and adjusts RngCore import source.
shared/src/circuit_breaker.rs Removes unused tokio::time::sleep import from tests.
shared/Cargo.toml Pins rand_core to 0.6.
Cargo.toml Enables Tokio test-util and pins hkdf version.
Cargo.lock Updates lockfile to reflect dependency resolution changes.
coordinator/tests/unit/test_main_module.py Reformats an assertion for style/clarity.
coordinator/pyproject.toml Adds a dependency-groups entry for flake8.
coordinator/poetry.lock Adds Poetry lockfile capturing Python dependency resolution.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Cargo.toml Outdated
x25519-dalek = { version = "2.0", features = ["static_secrets"] }
chacha20poly1305 = "0.10"
hkdf = "0.13"
hkdf = "=0.12.4"
Comment thread Cargo.toml Outdated
Comment on lines 55 to 58
hkdf = "=0.12.4"
sha2 = "0.10"
base64 = "0.22"
rand = "0.9"
Comment thread shared/src/crypto.rs Outdated
pub fn generate_base_nonce() -> [u8; 12] {
let mut nonce = [0u8; 12];
rand::rng().fill_bytes(&mut nonce);
OsRng.fill_bytes(&mut nonce);
Comment thread shared/Cargo.toml Outdated
Comment on lines +20 to +22
base64 = { workspace = true }
rand = { workspace = true }
rand_core = { workspace = true }
rand_core = "0.6"
Comment thread Cargo.toml Outdated
[workspace.dependencies]
# Async runtime
tokio = { version = "1.52", features = ["full"] }
tokio = { version = "1.52", features = ["full", "test-util"] }
@Theaxiom
Copy link
Copy Markdown
Member Author

Copilot apply changes based on the comments in this thread and also resolve merge conflicts.

Copilot AI and others added 3 commits April 30, 2026 01:04
…ope test-util to dev, unpin hkdf

Co-authored-by: Theaxiom <57013+Theaxiom@users.noreply.github.com>
…roach, unpin hkdf, scope test-util to dev

Co-authored-by: Theaxiom <57013+Theaxiom@users.noreply.github.com>
…tion, clarify benchmark comment

Agent-Logs-Url: https://github.com/100monkeys-ai/monkey-troop/sessions/9e14ec07-3321-4969-9414-4bbe3062ab11

Co-authored-by: Theaxiom <57013+Theaxiom@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 30, 2026

Copilot apply changes based on the comments in this thread and also resolve merge conflicts.

Applied all review feedback and resolved merge conflicts (commit fa3a815):

  • shared/src/crypto.rs: Bound OsRng to a mutable local variable (let mut rng = OsRng; rng.fill_bytes(...)) instead of calling on a temporary.
  • shared/Cargo.toml: Removed unused rand and rand_core direct dependencies; added tokio as a [dev-dependencies] entry with the test-util feature so it only activates during test builds.
  • Cargo.toml: Removed test-util from workspace-level tokio features; unpinned hkdf from exact version (=0.12.40.12.4).
  • Merge conflicts: Resolved conflicts between this branch and origin/main — kept the chacha20poly1305::aead::OsRng import approach, hkdf = "0.12.4" minimum version, and the workspace rand = "0.8" / rand_core that main introduced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants