Files
archie/internal/platform/pg/migrations/00007_steps_output_json.sql
sam 4877362223 fix(runs): a step hands back its value as recorded, so a resumed agent doesn't diverge from its journal (#1977)
Killing the binary mid-investigation and restarting it failed the run: the
first model request after the resume didn't match the recorded one. The tool
schemas pinned in a step reached the live attempt as written but the resume
as stored, and both the v2 encoder (compacting raw JSON) and jsonb (reordering
keys) rewrite them. Step now returns the decoded recorded value on the live
path too, and runs.steps.output is json, which keeps the text as written.
2026-11-16 00:36:19 +11:00

9 lines
405 B
SQL

-- +goose Up
-- A step's output must replay byte for byte: jsonb reorders keys and drops
-- whitespace, so a pinned value (a tool schema) read back differed from the
-- one a live attempt used, and a resumed agent diverged from its journal.
ALTER TABLE runs.steps ALTER COLUMN output TYPE json USING output::json;
-- +goose Down
ALTER TABLE runs.steps ALTER COLUMN output TYPE jsonb USING output::jsonb;