dream report: normalizeMutation discards ok/status, consumers can only string-match the summary
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 66/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- ai
Research direction
Start at normalizeMutation (dist/agent/dream.js:77) and find its TypeScript source, then trace where the dream report's ok, status and steps fields are dropped on the way to the flattened summary. Compare with the same flattening at dist/agent/agent.js:181 and agent.js:145 before changing anything, so all call sites stay consistent. Done means a returned report carries ok, status and steps again, and you can show a failed and a clean dream pass differing by report.ok alone rather than by the dream run failed: prefix.
Written by the indexing model from the issue text.
Description
runDream's report is flattened by normalizeMutation (dist/agent/dream.js:77), which keeps summary and filesChanged and discards ok and status. Consumers of the client therefore never receive the success/failure flag — they only get the flattened summary text.
Impact
The Pithagoras portal extension is affected: a dream (tidy-up) pass that ran out of steps is indistinguishable from a clean one via any structured field. The portal currently has to key off the literal dream run failed: prefix that normalizeMutation itself prepends to every failed outcome — brittle string matching that breaks silently if the wording ever changes. (Interim portal-side fix: thecodacus/pithagoras#382.)
Proposed fix
- Preserve
ok(andstatus, which already distinguishespartialfromfailed) on the report instead of discarding it. - Surface the
stepscount on the success path, so consumers can see how close a pass ran toAGENT_MAX_STEPSwithout guessing from wall-clock time.
With ok present, the portal-side check becomes report.ok === false and the string matching can be removed.
Note
The same dist carries near-identical step-limit strings for search (dist/agent/agent.js:181) and search-without-files (agent.js:145) — the same flattening probably applies there too; worth checking while touching this code.
- Dominant language
- TypeScript
- Stars
- 342
- Forks
- 78
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from thecodacus/understory
-
Difficulty 4/5 3-5 days Newbie friendliness 22/100
thecodacus/understory#59 ·
-
Dynamic seed text in memory_query description + list_changed invalidates clients' prompt cachesOpen
Difficulty 3/5 1-2 days Newbie friendliness 42/100
thecodacus/understory#58 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 50/100
thecodacus/understory#56 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
thecodacus/understory#54 ·
-
fix: duplicate top-level section write guards (complement to #35)Possibly taken @mebagwell claimed this 35 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
thecodacus/understory#52 ·
All issues in thecodacus/understory
Similar issues
-
kind:defect
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
mux-labs/mux-frontend#1240 ·
Maintainers usually reply within 1 day
-
area: agents-mcp priority: normal
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
Wait for the IDS correction dialog to settle in the stale-audit testPossibly taken @louistrue claimed this today. Openready
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Hono path parameters with a regex pattern keep the pattern in the OpenAPI pathPossibly taken @0z5a claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
cloudflare/chanfana#400 ·
Maintainers usually reply within 1 day