fix(api): declare hot_first in response schema so it isn't stripped - #177
Conversation
get_actions sets response.hot_first for observability, but extendResponseSchema never declared it. fast-json-stringify only serializes declared properties, so the field was silently dropped from every response — making it impossible to tell from the API whether hot-first routing engaged. Declare it next to hot_only, and assert both in the schema test.
There was a problem hiding this comment.
Code Review
This pull request adds the hot_first boolean property to the response schema in extendResponseSchema and updates the unit tests to ensure both hot_only and hot_first are defined, preventing them from being silently stripped by fast-json-stringify. There are no review comments, and the changes look correct and well-tested.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Pull request overview
This PR fixes a response-schema omission in the shared extendResponseSchema helper so the hot_first field set by get_actions is actually serialized (fast-json-stringify only emits declared schema properties). It also strengthens the unit test to assert both hot_only and hot_first are present in the schema, preventing silent regressions.
Changes:
- Declare
hot_firstin the base response schema returned byextendResponseSchema. - Extend the schema unit test to assert
hot_onlyandhot_firstare defined in the generated response schema.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/api/helpers/functions.ts |
Adds hot_first to the base response properties so it is serialized in API responses. |
tests/unit/api-helpers.test.ts |
Adds assertions ensuring hot_only and hot_first are declared in the response schema. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Follow-up to #176.
get_actionssetsresponse.hot_firstfor observability, butextendResponseSchemanever declared it — and fast-json-stringify only serializes declared properties, so the field was silently dropped from every response. That made it impossible to tell from the API whether hot-first routing engaged (it surfaced during live debugging of an operator deployment).hot_firstnext tohot_onlyinextendResponseSchema.hot_onlyandhot_firstin the schema unit test (would have caught this).tsc clean; 121 unit tests pass. No behavior change beyond the field now appearing in responses.