Skip to content

fix(gsd): Make task completion robust to malformed evidence JSON#3469

Closed
aryanjsingh wants to merge 1 commit intogsd-build:mainfrom
aryanjsingh:fix/issue-3464-gsdtaskcomplete-crashes-on-malformed-ver
Closed

fix(gsd): Make task completion robust to malformed evidence JSON#3469
aryanjsingh wants to merge 1 commit intogsd-build:mainfrom
aryanjsingh:fix/issue-3464-gsdtaskcomplete-crashes-on-malformed-ver

Conversation

@aryanjsingh
Copy link
Copy Markdown

Summary

Fixes a crash in the gsd_task_complete tool when smaller models generate malformed numeric values in verificationEvidence. The schema for exitCode and durationMs is updated to accept strings, and the handler now coerces these values to numbers, preventing parsing errors and improving reliability.

Changes

  • src/resources/extensions/gsd/db-tools.ts: Updated the VerificationEvidenceSchema to allow exitCode and durationMs to be either a number or a string. This prevents schema validation failures when the language model provides a numeric value as a string (e.g., "0" instead of 0) or syntactically invalid JSON like a bare minus sign.
  • src/resources/extensions/gsd/tools/complete-task.ts: Added coercion logic at the beginning of handleCompleteTask to normalize exitCode and durationMs to numbers. This handles cases where the model provides a string or a malformed value (like a bare -), ensuring data consistency before it's used or stored in the database.

Related Issue

Closes #3464

@github-actions github-actions bot added bug Something isn't working High Priority labels Apr 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

🟢 PR Risk Report — LOW

Files changed 2
Systems affected 0
Overall risk 🟢 LOW

@aryanjsingh aryanjsingh closed this Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working High Priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gsd_task_complete crashes on malformed verificationEvidence JSON from smaller models

1 participant