Skip to content

fix(orch): coerce UUID session_id to str + re-export _decode_token#38

Merged
dshapi merged 1 commit into
mainfrom
claude/fix-tests-after-rbac-merge
May 12, 2026
Merged

fix(orch): coerce UUID session_id to str + re-export _decode_token#38
dshapi merged 1 commit into
mainfrom
claude/fix-tests-after-rbac-merge

Conversation

@dshapi

@dshapi dshapi commented May 12, 2026

Copy link
Copy Markdown
Owner

Summary

Two CI failures introduced by the RBAC merge (PR #37):

  • SessionLifecycleEvent.session_id was switched from UUID to str for the API response model, but EventPublisher._emit() passes UUID. Pydantic v2 rejects that at construction time, breaking ~22 orchestrator tests. Added a @field_validator(mode="before") that coerces UUIDstr on both SessionLifecycleEvent and SessionEventListResponse.
  • 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 so the JWT-signature regression test compiles.

Test plan

  • pytest tests/ — 529 passed
  • pytest services/api/tests/ — 193 passed
  • pytest services/agent-orchestrator-service/tests/ — 383 passed (was 358 passed / 25 failed before the fix)

Generated by Claude Code

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-security

Copy link
Copy Markdown

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.

@dshapi dshapi merged commit da6da27 into main May 12, 2026
2 checks passed
@dshapi dshapi deleted the claude/fix-tests-after-rbac-merge branch May 12, 2026 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants