Skip to content

test: cover literal escapes in streaming JSON-RPC responses - #1300

Open
deoxyszc wants to merge 1 commit into
a2aproject:mainfrom
deoxyszc:test/html-escape-regressions
Open

deoxyszc wants to merge 1 commit into
a2aproject:mainfrom
deoxyszc:test/html-escape-regressions

Conversation

@deoxyszc

@deoxyszc deoxyszc commented Nov 9, 2026

Copy link
Copy Markdown

Context

Test-only follow-up to #1290, as invited in #1290 (comment). The production fix from #1293 is preserved unchanged.

Added coverage

Two test methods in two existing test files:

  • HTML-unescaping boundaries: preserve literal Unicode escape text for all eight supported lowercase/uppercase encodings. Separately use > with three, four and five preceding backslashes to exercise active escapes after an escaped pair, multiple escaped pairs, and an active escape after multiple pairs. This is 11 checks, rather than a redundant character-by-backslash Cartesian product. Existing tests already cover ordinary active escapes.
  • Streaming JSON-RPC serialization: round-trip a StreamResponse artifact update with structured tool-result data containing literal Unicode escapes, backslashes and actual HTML characters through JSONRPCUtils.toJsonRPCResultResponse(), then parse the result back to the original protobuf message. This covers the nested response serialization path, not network/SSE transport behavior.

No production changes, new dependencies, malformed-input contract tests or unrelated compatibility-wrapper tests.

Validation

On Java 21 against main 31455e95:

mvn -B -q -pl common,spec-grpc -am \
  -Dtest=HtmlEscapeUtilsTest,JSONRPCUtilsTest \
  -Dsurefire.failIfNoSpecifiedTests=false test

The two test classes ran 71 tests, with 0 failures, errors or skips. This count includes existing tests; this PR adds only the two methods described above. git diff --check also passed.

Extend HTML-unescaping regressions across supported escape encodings and representative backslash parity cases. Verify a streaming artifact DataPart round-trips through JSON-RPC response serialization without changing the merged implementation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
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