Improve the automated test coverage of this repository with real code...#32
Draft
kivo360 wants to merge 1 commit into
Draft
Improve the automated test coverage of this repository with real code...#32kivo360 wants to merge 1 commit into
kivo360 wants to merge 1 commit into
Conversation
kivo360
commented
Jul 12, 2026
kivo360
left a comment
Contributor
Author
There was a problem hiding this comment.
Reviewed and verified locally (checked out refs/pull/32/head).
Verdict: real bug fix + real tests — recommend merge.
The load-bearing change is in packages/sdk/src/errors.ts:
- const message = parsedMessage ?? bodyText.slice(0, 200) ?? `${path} → ${res.status}`;
+ const message = parsedMessage ?? (bodyText ? bodyText.slice(0, 200) : `${path} → ${res.status}`);
This is a genuine fix: ''.slice(0, 200) returns '', not null/undefined, so the old ?? fallback never fired — an empty response body produced a blank error message instead of the path → status fallback. The guard restores the intended fallback.
Tests: ran errors.test.ts (30), environments.test.ts (16), devtools/args.test.ts (33) → 79/79 pass. errors.test.ts includes coverage of the empty-body path.
Recommend merge.
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.
Automated change by a Mozart background run.
Task
Improve the automated test coverage of this repository with real code changes across multiple files. Constraint: packages/acp-client tests and packages/sdk/test/history.test.ts were covered by a recent PR, so pick DIFFERENT modules. Steps: (1) explore packages/ and pick 2 or 3 important source modules that lack dedicated unit tests, skipping generated code and type-only files; consider packages/chat, packages/tool-renderers, packages/deploy, or packages/sdk modules other than history. (2) Study the existing test conventions (package.json scripts, existing test files) and write thorough unit tests covering edge cases and error paths. (3) If a new test exposes a genuine bug in a source module, fix the module. (4) Run the tests you added, scoped to the packages you touched, NOT the whole monorepo, and iterate until they pass. Hard requirements: at least 3 new test files spanning at least 2 different packages; do not reformat or refactor unrelated code; do not change README or docs.
Run
1f06c0d3-cea1-4669-8183-07b67e724312· session1b21ea5d-a2e7-4819-9148-cc6d2efeafb8