fix(project): simplify agentcore spec serialization errors - #2031
Merged
notgitika merged 3 commits intoAug 18, 2026
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## refactor #2031 +/- ##
============================================
- Coverage 97.09% 97.09% -0.01%
============================================
Files 381 381
Lines 22778 22774 -4
============================================
- Hits 22116 22112 -4
Misses 662 662 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Hweinstock
marked this pull request as ready for review
August 18, 2026 22:29
Hweinstock
marked this pull request as draft
August 18, 2026 22:33
Hweinstock
force-pushed
the
fix/avoid-writing-corrupted-config
branch
from
August 18, 2026 22:42
f261c3d to
3257f9a
Compare
Hweinstock
marked this pull request as ready for review
August 18, 2026 22:45
aidandaly24
approved these changes
Aug 18, 2026
aidandaly24
left a comment
Contributor
There was a problem hiding this comment.
This looks good to me
Comment on lines
-66
to
+70
| try { | ||
| const spec = await this.json.read(configPath, ProjectSpecSchema); | ||
| return { | ||
| name: spec.name, | ||
| rootPath, | ||
| spec, | ||
| }; | ||
| } catch (error) { | ||
| // A malformed agentcore.json is a user-correctable problem, not a crash. | ||
| if (error instanceof DeserializationError) { | ||
| throw new InputValidationError(`invalid project configuration at ${configPath}`, { | ||
| cause: error, | ||
| }); | ||
| } | ||
| throw error; | ||
| } | ||
| const spec = await this.json.read(configPath, ProjectSpecSchema); | ||
| return { | ||
| name: spec.name, | ||
| rootPath, | ||
| spec, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
This PR solves two related problems with project spec serialization.
DeserializationErrordoes not extend the base error. (think it preceded it)Solution
Testing
added a unit test to verify the case by corrupting the agentcore.json and validating we fail early.