Skip to content

Improve the automated test coverage of this repository with real code...#32

Draft
kivo360 wants to merge 1 commit into
mainfrom
mozart/run-1f06c0d3
Draft

Improve the automated test coverage of this repository with real code...#32
kivo360 wants to merge 1 commit into
mainfrom
mozart/run-1f06c0d3

Conversation

@kivo360

@kivo360 kivo360 commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

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 · session 1b21ea5d-a2e7-4819-9148-cc6d2efeafb8

@kivo360 kivo360 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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