Commit 9678d78
UN-2946 [MISC] Fix empty Default tab in Prompt Studio Combined Output (#1956)
[MISC] [FIX] Fix empty Default tab in Prompt Studio Combined Output
The DISTINCT-ON refactor in fetch_default_output_response built the
outputs_index with str(o.prompt_id), but PromptStudioOutputManager names
its FK field ``prompt_id`` (shadowing the PK column ``prompt_id_id``), so
``o.prompt_id`` returns the related ToolStudioPrompt instance, not a UUID.
``str()`` on the instance produces ``"ToolStudioPrompt object (<uuid>)"``,
which never matches the canonical-UUID lookup keys — every prompt
resolved to "" and the Default tab rendered as an empty payload.
Use ``prompt_id_id`` for the index key. Side benefit: no N+1 from lazy
loading the related instance per row, which was the perf intent of the
original commit.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 5214892 commit 9678d78
1 file changed
Lines changed: 3 additions & 1 deletion
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
| 326 | + | |
| 327 | + | |
326 | 328 | | |
327 | | - | |
| 329 | + | |
328 | 330 | | |
329 | 331 | | |
330 | 332 | | |
| |||
0 commit comments