fix(orch): coerce UUID session_id to str + re-export _decode_token#38
Merged
Conversation
Two CI failures introduced by the RBAC merge: 1. SessionLifecycleEvent.session_id was changed from UUID to str so that chat IDs like "session-1778614829220" round-trip through the API response model, but pydantic v2 rejects a UUID instance for a str field at construction time. EventPublisher._emit() passes UUID, so every test that exercises the session pipeline blew up with "Input should be a valid string ... input_type=UUID". Add a before-validator on both SessionLifecycleEvent and SessionEventListResponse that coerces UUID -> str. Cheaper than changing every emit site, and keeps the API contract as plain str. 2. tests/test_auth_deps.py imports _decode_token from dependencies.auth, but the shim was reduced to re-exporting IdentityContext + get_current_identity only. Re-export _decode_token too so the JWT-signature regression test compiles. https://claude.ai/code/session_015Pp147sgmYk83YZEvaqStp
|
Strix is installed on this repository, but we could not run this PR security review because this workspace does not have an active plan. If you'd like to continue receiving code reviews, you can add a payment method or manage billing here. |
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
Two CI failures introduced by the RBAC merge (PR #37):
SessionLifecycleEvent.session_idwas switched fromUUIDtostrfor the API response model, butEventPublisher._emit()passesUUID. Pydantic v2 rejects that at construction time, breaking ~22 orchestrator tests. Added a@field_validator(mode="before")that coercesUUID→stron bothSessionLifecycleEventandSessionEventListResponse.tests/test_auth_deps.pyimports_decode_tokenfromdependencies.auth, but the shim was reduced to re-exportingIdentityContext+get_current_identityonly. Re-export_decode_tokenso the JWT-signature regression test compiles.Test plan
pytest tests/— 529 passedpytest services/api/tests/— 193 passedpytest services/agent-orchestrator-service/tests/— 383 passed (was 358 passed / 25 failed before the fix)Generated by Claude Code