Commit 251ed86
fix: backfill rollout status fields from logs when polling completes (#451)
* fix: backfill rollout status fields from logs when polling completes
The lightweight `/status` endpoint on the tracing gateway only returns the
status code; `Message`, `Details`, and `Extras` still live on the Logs
table. After PR #446 stopped reading from `/logs` on terminal status, the
SDK was constructing `Status(code=..., message="", details=[])` for every
completed rollout and `EvalProtocolError(message="")` for failures, which
broke `tests/remote_server/test_remote_fireworks_propagate_status.py`
(`assert row.rollout_status.message == "test error"`).
Restore the two-phase polling shape from the original PR: poll `/status`
for the code, and on a terminal (non-RUNNING) code do one
`async_search_logs` call to backfill `message`/`details`/`extras` from
the matching log row. This is still ~1000x cheaper on the Logs table than
the pre-#446 polling loop because the search runs once per rollout
completion instead of every poll interval.
Made-with: Cursor
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: match backfilled log status to terminal status code
Bugbot pointed out that the backfill loop could pick an earlier
RUNNING/partial status log instead of the terminal one when a rollout
emits multiple status-bearing logs. The reported `code` was always
correct (it came from /status), but `message`/`details`/`extras` could
be attached from the wrong row and the raised exception would carry
misleading text.
Match the log row's status code to the terminal code returned by
/status so the backfill is deterministic.
Made-with: Cursor
---------
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 86a52a4 commit 251ed86
1 file changed
Lines changed: 23 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
144 | 164 | | |
145 | 165 | | |
146 | 166 | | |
| |||
152 | 172 | | |
153 | 173 | | |
154 | 174 | | |
155 | | - | |
156 | | - | |
| 175 | + | |
157 | 176 | | |
158 | 177 | | |
159 | 178 | | |
| |||
0 commit comments