Skip to content

fix: recover setup replies missing the final JSON brace - #75

Open
cooper (czxtm) wants to merge 1 commit into
mainfrom
fix/setup-agent-json
Open

cooper (czxtm) wants to merge 1 commit into
mainfrom
fix/setup-agent-json

Conversation

@czxtm

Copy link
Copy Markdown
Member

Completed setup-agent streams can omit the final outer JSON brace, causing malformed-JSON warnings and repeated formatting requests. Recover exactly that delimiter only when strict decoding and existing semantic validation succeed. Reparse saved replies before model correction while preserving frozen plans and saved answers; incomplete nested content remains rejected.

Validation:

  • Regression tests reproduced new and saved reply failures before the fix and now pass.
  • TMPDIR=/private/tmp go -C apps/stackpanel-go test ./internal/setupagent ./cmd/cli -count=1 passed.
  • go -C apps/stackpanel-go build ./... passed.
  • Installed Codex smoke test TestInstalledCodexReplyCorrection passed.
  • bun run check-types, scoped formatting/diff checks, and calldiff passed.
  • Independent reviewer approved with no blocking findings; existing ADRs remain consistent.

Separate verification failures are tracked in stackpanel-jk2: existing TypeScript lint errors, the removed nixfmt-rfc-style hook in nix flake check, and pkg/nixdata TestSetKey. The latter also fails on the original commit in a clean worktree. Canonical TMPDIR avoids additional existing macOS path-comparison failures.

Fixes stackpanel-0h7.

Completed provider replies can omit only the outer closing brace. Recover that delimiter only after strict decoding and semantic validation, and recover saved replies before requesting another model response. Preserve frozen-plan guards and reject incomplete nested content. Fixes stackpanel-0h7.
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Preview deployed to pr-75 — https://pr-75.stackpanel.com

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Docs preview deployed to pr-75: https://stackpanel-docs-pr-75.drkmttr.workers.dev

This branch was successfully deployed

2 active deployments
docs-preview — 0aa27d18 Deployed Nov 6, 2026 by czxtm via deploy #254
pr-75 — 0aa27d18 Deployed Nov 6, 2026 by czxtm via deploy #265
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant