Skip to content

fix(client): preserve numeric zero in task result turn counts - #104

Open
Chris0Jeky wants to merge 1 commit into
google:mainfrom
Chris0Jeky:codex/client-zero-turns
Open

Chris0Jeky wants to merge 1 commit into
google:mainfrom
Chris0Jeky:codex/client-zero-turns

Conversation

@Chris0Jeky

@Chris0Jeky Chris0Jeky commented Sep 14, 2026

Copy link
Copy Markdown

Fixes #103.

TaskResult.from_payload() currently treats numeric turns=0 as missing:
result.turns becomes None, or uses current_turn when that alias is present.
String "0" already works.

This patch preserves numeric zero and its precedence while keeping existing
fallback for null, empty strings and False; True still converts to 1. Raw
payloads and other field parsing are unchanged.

At base 371aa6df56880643da57b30da936e9812fb0ec66, the zero regressions fail.
At head c5f29e69d5739e3253d8297e60d2d870776ba729, all 24 client tests and
20 subtests pass on Windows/Python 3.12.14, with imports verified against this
package. Restoring the old parser makes the regressions fail again.

PYTHONPATH=packages/artemis-client/src python -m pytest packages/artemis-client/tests
ruff check packages/artemis-client
ruff format --check packages/artemis-client

Package lint/format, protected-core types and the quality ratchet pass.
The fork CI run
passes frontend/build and package smoke; both Python jobs stop at the same
11 pre-existing Ruff findings in playground/backend_manager. An isolated Linux comparison
has the same 95 failed IDs on base and patch (2090 versus 2094 passed); its
environment-modified baseline is red. This is a parser correction, without a
live-server reproduction or a full-suite pass.

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.

TaskResult loses numeric zero turn counts

1 participant