Skip to content

fix(python-sdk): preserve Unicode separators in harness JSONL - #1148

Merged
santoshkumarradha merged 1 commit into
Agent-Field:mainfrom
remote-controlled-man:codex/prflow-1b50a1316b3c
Nov 3, 2026
Merged

santoshkumarradha merged 1 commit into
Agent-Field:mainfrom
remote-controlled-man:codex/prflow-1b50a1316b3c

Conversation

@remote-controlled-man

Copy link
Copy Markdown
Contributor

Summary

Preserve valid JSONL events containing literal U+0085, U+2028, or U+2029 in CLI output. str.splitlines() treats those characters as record boundaries even inside JSON strings, so the shared parser silently discards the event. An OpenCode text event can consequently disappear while the provider reports success with no result.

Split records on LF as specified by JSON Lines, retaining CRLF support and the existing handling of blank or malformed lines. This fixes the shared parsing path used by the OpenCode, Codex, and Pi providers.

Type of change

  • Bug fix

Test plan

  • Regression matrix: all three Unicode separators with LF and CRLF framing failed before the fix.
  • Shared CLI helper and affected provider suites: 106 passed.
  • Local executable fixture through OpenCodeProvider.execute(): before the fix, result=null and 2 events; after the fix, exact text preserved and all 3 events. No model/API calls.
  • ./scripts/test-all.sh: Control Plane and Go SDK passed in the cached Linux Go environment; Python SDK 2948 passed / 4 skipped / 38 deselected; TypeScript SDK 1383 passed / 1 skipped; Web UI 837 passed.
  • cd sdk/python && ruff check .
  • cd sdk/python && mypy --config-file mypy.ini agentfield/: 86 source files passed.
  • make fmt tidy: completed; baseline-only formatting changes were reverted to keep this PR focused. No module files changed. Full tests then ran on the final tree.
  • Registered additional checks: memory-event suites with websockets 12 and 15, 28 passed each; upstream Python memory benchmark passed.

The repository's default exclusions for live/functional tests were retained. Web UI lint is opt-in in test-all.sh and was not enabled for this Python-only change.

Test coverage

  • Added regression coverage for every changed behavior, including both supported line endings.
  • Repository coverage CI result pending.

Checklist

  • Read docs/CONTRIBUTING.md and docs/DEVELOPMENT.md.
  • Focused conventional commit with sign-off.

Copilot AI balanced review requested due to automatic review settings November 3, 2026 12:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Performance

SDK Memory Δ Latency Δ Tests Status
Python 9.1 KB - 0.26 µs -26% ✓ ✓

✓ No regressions detected

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

📊 Coverage gate

Thresholds from .coverage-gate.toml: per-surface ≥ 84%, aggregate ≥ 85%, max per-surface regression ≤ 1.0 pp, max aggregate regression ≤ 0.50 pp.

Surface Current Baseline Δ
control-plane 88.20% 87.40% ↑ +0.80 pp 🟡
sdk-go 93.70% 92.00% ↑ +1.70 pp 🟢
sdk-python 94.73% 93.73% ↑ +1.00 pp 🟢
sdk-typescript 92.27% 90.42% ↑ +1.85 pp 🟢
web-ui 84.89% 84.79% ↑ +0.10 pp 🟡
aggregate 86.11% 85.75% ↑ +0.36 pp 🟡

✅ Gate passed

No surface regressed past the allowed threshold and the aggregate stayed above the floor.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

📐 Patch coverage gate

Threshold: 80% on lines this PR touches vs origin/main (from .coverage-gate.toml:thresholds.min_patch).

Surface Touched lines Patch coverage Status
control-plane 0 — ➖ no changes
sdk-go 0 — ➖ no changes
sdk-python 0 — ➖ no changes
sdk-typescript 0 — ➖ no changes
web-ui 0 — ➖ no changes

✅ Patch gate passed

Every surface whose lines were touched by this PR has patch coverage at or above the threshold.

@santoshkumarradha santoshkumarradha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed the JSONL delimiter handling and Unicode separator coverage. The focused Python harness CLI tests pass locally, and CLA plus required checks are green.

@santoshkumarradha
santoshkumarradha added this pull request to the merge queue Nov 3, 2026
Merged via the queue into Agent-Field:main with commit 75d8f2a Nov 3, 2026
28 checks passed
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.

3 participants