SendMessage previously always sent from the first configured account (resolve_sending_account) with no way to choose, silently sending from the wrong identity the moment a second account existed.
Adds optional string account_id = 7; to SendMessageRequest (additive, next unused field number). When set, resolves that specific account; a non-existent account_id fails with a new, distinct SendError::AccountNotFound(String) variant rather than a silent fallback. NoAccountConfigured stays reserved for "zero accounts exist". Omitting account_id preserves today's exact "first configured account" behavior.
Threads the selector through ComposeRequest, resolve_sending_account, send_message_for_account/send_message_with_injected_sender, the SendMessage gRPC handler, and a new nuncio-cli mail send --account <id> flag.
Regenerated the nuncio.v1 descriptor golden (crates/nuncio-proto/proto/nuncio/v1/descriptor.bin) per the contract-stability recipe; contract_stability::descriptor_matches_committed_golden passes.
send.rs: new tests proving (a) two accounts + explicit account_id for the second sends from that account (From: assertion against MockMessageSender), and (b) an unknown account_id fails with SendError::AccountNotFound, never a silent fallback.
grpc.rs/spine_e2e_test.rs: existing SendMessage request literals updated to pass account_id: None, preserving current single/first-account behavior.
nuncio-cli/src/runner.rs: extended the existing mail send stub-daemon test to also exercise --account <id>, asserting the daemon receives the exact account_id over the wire.
Mail remains mounted behind its BearerAuthInterceptor (no mounting change); auth tests unaffected.
All mock-only (MockMessageSender / stub gRPC daemon); no live network.
Gate output
$ cargo fmt --all -- --check
(clean, no output)
$ cargo check-all
Finished `dev` profile [unoptimized + debuginfo] target(s) in 6.05s
(zero warnings)
$ cargo test-all
... 419 tests passed across the workspace; 0 failed; 0 ignored ...
Test plan
cargo fmt --all -- --check
cargo check-all (clippy --all-targets --workspace -D warnings, zero warnings)
cargo test-all (419 passed, 0 failed, 0 ignored)
contract_stability::descriptor_matches_committed_golden passes with the regenerated golden
## Summary
- `SendMessage` previously always sent from the first configured account (`resolve_sending_account`) with no way to choose, silently sending from the wrong identity the moment a second account existed.
- Adds `optional string account_id = 7;` to `SendMessageRequest` (additive, next unused field number). When set, resolves that specific account; a non-existent `account_id` fails with a new, distinct `SendError::AccountNotFound(String)` variant rather than a silent fallback. `NoAccountConfigured` stays reserved for "zero accounts exist". Omitting `account_id` preserves today's exact "first configured account" behavior.
- Threads the selector through `ComposeRequest`, `resolve_sending_account`, `send_message_for_account`/`send_message_with_injected_sender`, the `SendMessage` gRPC handler, and a new `nuncio-cli mail send --account <id>` flag.
- Regenerated the `nuncio.v1` descriptor golden (`crates/nuncio-proto/proto/nuncio/v1/descriptor.bin`) per the contract-stability recipe; `contract_stability::descriptor_matches_committed_golden` passes.
Closes #196. Refs #170.
## Tests
- `send.rs`: new tests proving (a) two accounts + explicit `account_id` for the second sends from that account (`From:` assertion against `MockMessageSender`), and (b) an unknown `account_id` fails with `SendError::AccountNotFound`, never a silent fallback.
- `grpc.rs`/`spine_e2e_test.rs`: existing `SendMessage` request literals updated to pass `account_id: None`, preserving current single/first-account behavior.
- `nuncio-cli/src/runner.rs`: extended the existing `mail send` stub-daemon test to also exercise `--account <id>`, asserting the daemon receives the exact `account_id` over the wire.
- `Mail` remains mounted behind its `BearerAuthInterceptor` (no mounting change); auth tests unaffected.
- All mock-only (`MockMessageSender` / stub gRPC daemon); no live network.
## Gate output
```
$ cargo fmt --all -- --check
(clean, no output)
$ cargo check-all
Finished `dev` profile [unoptimized + debuginfo] target(s) in 6.05s
(zero warnings)
$ cargo test-all
... 419 tests passed across the workspace; 0 failed; 0 ignored ...
```
## Test plan
- [x] `cargo fmt --all -- --check`
- [x] `cargo check-all` (clippy `--all-targets --workspace -D warnings`, zero warnings)
- [x] `cargo test-all` (419 passed, 0 failed, 0 ignored)
- [x] `contract_stability::descriptor_matches_committed_golden` passes with the regenerated golden
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
SendMessagepreviously always sent from the first configured account (resolve_sending_account) with no way to choose, silently sending from the wrong identity the moment a second account existed.optional string account_id = 7;toSendMessageRequest(additive, next unused field number). When set, resolves that specific account; a non-existentaccount_idfails with a new, distinctSendError::AccountNotFound(String)variant rather than a silent fallback.NoAccountConfiguredstays reserved for "zero accounts exist". Omittingaccount_idpreserves today's exact "first configured account" behavior.ComposeRequest,resolve_sending_account,send_message_for_account/send_message_with_injected_sender, theSendMessagegRPC handler, and a newnuncio-cli mail send --account <id>flag.nuncio.v1descriptor golden (crates/nuncio-proto/proto/nuncio/v1/descriptor.bin) per the contract-stability recipe;contract_stability::descriptor_matches_committed_goldenpasses.Closes #196. Refs #170.
Tests
send.rs: new tests proving (a) two accounts + explicitaccount_idfor the second sends from that account (From:assertion againstMockMessageSender), and (b) an unknownaccount_idfails withSendError::AccountNotFound, never a silent fallback.grpc.rs/spine_e2e_test.rs: existingSendMessagerequest literals updated to passaccount_id: None, preserving current single/first-account behavior.nuncio-cli/src/runner.rs: extended the existingmail sendstub-daemon test to also exercise--account <id>, asserting the daemon receives the exactaccount_idover the wire.Mailremains mounted behind itsBearerAuthInterceptor(no mounting change); auth tests unaffected.MockMessageSender/ stub gRPC daemon); no live network.Gate output
Test plan
cargo fmt --all -- --checkcargo check-all(clippy--all-targets --workspace -D warnings, zero warnings)cargo test-all(419 passed, 0 failed, 0 ignored)contract_stability::descriptor_matches_committed_goldenpasses with the regenerated golden