Skip to content

fix: avoid mutating caller message configuration - #725

Merged
bartek-gralewicz merged 2 commits into
a2aproject:mainfrom
sunruize93-cmyk:codex/fix-client-config-copy
Sep 16, 2026
Merged

bartek-gralewicz merged 2 commits into
a2aproject:mainfrom
sunruize93-cmyk:codex/fix-client-config-copy

Conversation

@sunruize93-cmyk

Copy link
Copy Markdown
Contributor

Description

Fixes #724.

Copy the caller's message configuration before applying client defaults. This prevents frozen configurations from throwing and stops one client's default push callback from leaking into a request reused with another client. Explicit request values keep their existing precedence.

Regression tests cover frozen configurations and reuse across clients through both sendMessage() and sendMessageStream(). All four new cases fail on the baseline and pass with the fix.

Validation

  • npm test: 1,550 tests passed across 68 files.
  • npm run lint:ci: passed (source/test TypeScript and ESLint).
  • npm run build and npm run test-build: passed.
  • No public API or wire-format changes; no documentation changes needed.

Checklist

  • Follow the contributing guide
  • Conventional Commit PR title
  • Tests and linter pass
  • Appropriate docs updated if necessary (not needed)

AI-assisted implementation and regression testing.

Resolve client defaults on a per-call configuration copy. Preserve frozen inputs and isolate default push callbacks across client reuse.

Fixes a2aproject#724

AI-assisted implementation and regression testing.
@sunruize93-cmyk
sunruize93-cmyk requested a review from a team as a code owner September 15, 2026 04:10
@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

🧪 Code Coverage

⬇️ Download Full Report

No coverage changes.

Generated by coverage-comment.yml

@sunruize93-cmyk

sunruize93-cmyk commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor Author

The Node 22 TCK failure is a false positive in the pinned 0.3.0.beta5 test, rather than a configuration-copy regression.

test_tasks_resubscribe_nonexistent receives HTTP 404, code -32001, with Task not found: non-existent-task-id-61501690-1086-477f-a55d-5f70f0d5e179. The generated UUID contains 501. The exception handler checks "501" in error_msg before checking 404 / not found, so it misclassifies the task ID as an HTTP 501 status.

Local verification:

  • Replayed the actual pinned test function against the captured REST error: reproduced the same failure.
  • Changed only 61501690 to 61401690: the identical HTTP 404 error passes. An HTTP 501 control still fails.
  • Sent real requests to this branch's compat SUT with both IDs: both correctly return HTTP 404 / -32001. This server-side resubscribe path does not use the modified client configuration helper.

The Node 24 job's logs also show all three capability transport suites passing before matrix cancellation. No SDK changes are needed for this particular failure.

AI-assisted diagnosis and local validation; the full TCK suite was not rerun locally.

I attempted to rerun the failed jobs, but GitHub rejected the request with Must have admin rights to Repository. Could a maintainer rerun the failed/cancelled TCK jobs, please?

@bartek-gralewicz bartek-gralewicz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for contributing to the SDK!

@bartek-gralewicz
bartek-gralewicz merged commit e3a6428 into a2aproject:main Sep 16, 2026
16 checks passed
bartek-gralewicz added a commit that referenced this pull request Sep 18, 2026
🤖 I have created a release *beep* *boop*
---


## [1.2.0](v1.1.0...v1.2.0)
(2026-09-18)


### Features

* **server:** Introduce SettleByTaskId method
([#692](#692))
([e856bda](e856bda))


### Bug Fixes

* accept GetExtendedAgentCard JSON-RPC calls with omitted params
([#687](#687))
([047d970](047d970))
* avoid mutating caller message configuration
([#725](#725))
([e3a6428](e3a6428))
* **client:** cache the extended Agent Card only after signature
verification ([#711](#711))
([55b601c](55b601c))
* guard terminal state transitions and make cancelTask atomic
([#636](#636))
([7b87c94](7b87c94))
* preserve call context for JSON-RPC tenant requests
([#708](#708))
([ae20aca](ae20aca))
* preserve HeadersInit in authenticating fetch
([#721](#721))
([f8c33fa](f8c33fa))
* preserve historyLength=0 and reject invalid REST listTasks pageSize
([#685](#685))
([32c1865](32c1865))
* reject empty task IDs with RequestMalformedError in getTask/cancelTask
([#629](#629))
([71aae97](71aae97))
* reject invalid ListTasks status filters with RequestMalformedError
([#631](#631))
([a881fae](a881fae))
* reject missing required extensions before mutating task history
([#690](#690))
([3b4ef3f](3b4ef3f))
* reject whitespace-only taskId on sendMessage
([#689](#689))
([85227a0](85227a0))
* return 404/-32001 for missing push notification configs
([#630](#630))
([34f06e3](34f06e3))
* scope ExecutionEventBusManager by tenant and owner to match TaskStore
([#707](#707))
([69d8899](69d8899))
* stamp the resolved taskId onto sendMessage push configs
([#688](#688))
([cfb19a8](cfb19a8))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: Bartek Gralewicz <[email protected]>
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.

[Bug]: Client send methods mutate reusable request configuration

2 participants