Skip to content

ref(seer-rpc): introduce EmptyResponse sentinel for {} not-found wire - #117779

Merged
azulus merged 1 commit into
masterfrom
jeremy/seer-rpc-type-agent-trace-waterfall
Jun 16, 2026
Merged

ref(seer-rpc): introduce EmptyResponse sentinel for {} not-found wire#117779
azulus merged 1 commit into
masterfrom
jeremy/seer-rpc-type-agent-trace-waterfall

Conversation

@azulus

@azulus azulus commented Jun 16, 2026

Copy link
Copy Markdown
Member

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_waterfallEAPTrace | EmptyResponse. Previously returned dict[str, Any] via trace.dict() if trace else {}. Surfaces the underlying typed EAPTrace directly.
  • get_latest_issue_eventIssueDetails | 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.

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 16, 2026
@azulus
azulus force-pushed the jeremy/seer-rpc-type-agent-trace-waterfall branch from e433091 to 7869c3e Compare June 16, 2026 16:07
@azulus azulus changed the title ref(seer-rpc): type rpc_get_trace_waterfall return as EAPTrace | None ref(seer-rpc): introduce EmptyResponse sentinel for {} not-found wire Jun 16, 2026
@azulus
azulus marked this pull request as ready for review June 16, 2026 16:11
@azulus
azulus requested review from a team as code owners June 16, 2026 16:11
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
azulus force-pushed the jeremy/seer-rpc-type-agent-trace-waterfall branch from 7869c3e to db586e6 Compare June 16, 2026 16:21
@azulus
azulus merged commit afe69fe into master Jun 16, 2026
64 checks passed
@azulus
azulus deleted the jeremy/seer-rpc-type-agent-trace-waterfall branch June 16, 2026 17:12
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants