Repository navigation
fix(fleet-queue): validate session id format in verb_bind (#8287) - #11217
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 29 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…-session-validation
Fix #8287 — validate session id format in queue
verb_bindFixes #8287.
verb_bind(pkgs/fleet/crates/fleet-queue/src/turso_queue.rs) readsession_idraw from the request and bound it with no format validation, so a fat-fingered or stale id (bind --session-id not-a-session, reproduced in the #8217 acceptance) bound a ghost session and stranded the task until stuck-bound supervision recovered it.Change, per the routed fix shape on #8287 (reuse the existing predicate, never fork a second definition):
client::valid_session_id(the queue: per-task session binding history + model timeline — session_id join to raw opencode data (extends #8176) #9046 predicate the client/claim paths keep:ses_prefix + alphanumeric/underscore) is promoted topub(crate)as the crate's one session-id predicate.verb_bindvalidates against it before any state is touched and refuses a malformed id as a usage error (exit 2,invalid session_id ...), leaving the task unbound. The composed claim-flow bind step inherits the guard.bind_rejects_malformed_session_id_8287: malformed shapes (not-a-session, empty, bareses_, an injection-shaped string) all refuse with exit 2 pre-store (dummy backend proves the refusal precedes any store access); a well-formed id is not refused as invalid.Tests:
cargo test -p fleet-queue --features queue-broker --lib— 372 passed, 0 failed, including the new test and the existingvalid_session_id_9046predicate test.cargo fmt -p fleet-queueapplied.Queue: task 20115, lane code-d.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.