ref(seer-rpc): introduce EmptyResponse sentinel for {} not-found wire - #117779
Merged
Conversation
azulus
force-pushed
the
jeremy/seer-rpc-type-agent-trace-waterfall
branch
from
June 16, 2026 16:07
e433091 to
7869c3e
Compare
{} not-found wire
azulus
marked this pull request as ready for review
June 16, 2026 16:11
gricha
approved these changes
Jun 16, 2026
Introduces a Pydantic sentinel — `class EmptyResponse(BaseModel)` — whose
`.dict()` produces `{}`. RPC methods whose pre-typed return shape was
`{}` for not-found now use `SomeModel | EmptyResponse` instead of
`SomeModel | None`, restoring byte-identical wire while keeping the
typed registry contract.
Applied here:
- `rpc_get_trace_waterfall` -> `EAPTrace | EmptyResponse` (was returning
`dict[str, Any]` via `trace.dict() if trace else {}`)
- `get_latest_issue_event` -> `IssueDetails | EmptyResponse` (backfill for
the prior PR which had switched `{}` -> `None` and changed the wire)
Wire bytes: success path emits the typed model's `.dict()` (same as
before for both functions); not-found path emits `{}` (matches the
pre-typed return).
azulus
force-pushed
the
jeremy/seer-rpc-type-agent-trace-waterfall
branch
from
June 16, 2026 16:21
7869c3e to
db586e6
Compare
sehr-m
pushed a commit
that referenced
this pull request
Jun 23, 2026
…re (#117779) Adds a Pydantic sentinel — `class EmptyResponse(BaseModel)` — whose `.dict()` produces `{}`. RPC methods whose pre-typed not-found return was `{}` can use `SomeModel | EmptyResponse` instead of `SomeModel | None`, keeping byte-identical wire bytes while still satisfying the typed-registry contract. Applied to two functions: - `rpc_get_trace_waterfall` → `EAPTrace | EmptyResponse`. Previously returned `dict[str, Any]` via `trace.dict() if trace else {}`. Surfaces the underlying typed `EAPTrace` directly. - `get_latest_issue_event` → `IssueDetails | EmptyResponse`. Backfill for the earlier typing PR that had switched `{}` → `None` and unintentionally changed the wire on the not-found path. This restores the original `{}` bytes. Wire-no-op: success paths emit the typed model's `.dict()` (same as before for both); not-found path emits `{}` for both.
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.
Adds a Pydantic sentinel —
class EmptyResponse(BaseModel)— whose.dict()produces{}. RPC methods whose pre-typed not-found return was{}can useSomeModel | EmptyResponseinstead ofSomeModel | None, keeping byte-identical wire bytes while still satisfying the typed-registry contract.Applied to two functions:
rpc_get_trace_waterfall→EAPTrace | EmptyResponse. Previously returneddict[str, Any]viatrace.dict() if trace else {}. Surfaces the underlying typedEAPTracedirectly.get_latest_issue_event→IssueDetails | EmptyResponse. Backfill for the earlier typing PR that had switched{}→Noneand unintentionally changed the wire on the not-found path. This restores the original{}bytes.Wire-no-op: success paths emit the typed model's
.dict()(same as before for both); not-found path emits{}for both.