Skip to content

test(core): cover pinned-model structured retry capabilities - #3960

Open
pengmoubuaixuexi wants to merge 4 commits into
agentscope-ai:mainfrom
pengmoubuaixuexi:fix/per-call-structured-tool-choice
Open

pengmoubuaixuexi wants to merge 4 commits into
agentscope-ai:mainfrom
pengmoubuaixuexi:fix/per-call-structured-tool-choice

Conversation

@pengmoubuaixuexi

@pengmoubuaixuexi pengmoubuaixuexi commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

AgentScope-Java Version

2.1.0-SNAPSHOT; refreshed onto main 30dc84b59e646f443dcf1870d66b3225e6210582.

Description

Regression coverage for #3959, following the production correction in #3965. There is no production-code diff against current main.

The four default/pinned-model capability combinations assert that a structured-output retry checks the effective model's named-tool-choice capability, completes in two selected-model requests, and never invokes the default model. Both mismatch directions and matching controls are covered. The pin uses RuntimeContext.put(Model.class, selected).

The complete contribution remains three files (139 additions): the unchanged 135-line regression class and two matching EN/ZH notes in docs/dev. Stable docs/v2 pages match upstream exactly.

CI follow-up

The former head cfb7c7b passed Windows and all four new regression cases on Ubuntu, but Ubuntu's full build timed out in the pre-existing RocketMQ recovery test. Upstream has since merged #4176, including the fake broker acknowledgement/redelivery-window correction and richer recovery diagnostics. I merged current main normally, including that correction and the upstream A2A SDK dependency update. Those are upstream contributions, not new fixes authored by this PR. This supersedes the request to rerun the old failed job; the updated head needs fresh CI.

Validation

Windows / Temurin 17.0.15 / Maven 3.9.12; JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8:

mvn -B -T1C -pl :agentscope-extensions-durable-rocketmq -am -Dtest=RocketMqExecutionTest,ReActAgentPerCallStructuredToolChoiceTest,ReActAgentStructuredOutputTest,ReActAgentModelSelectionTest -Dsurefire.failIfNoSpecifiedTests=false test

Latest refreshed branch: 34 cases / 33 passed / 1 skipped / zero failures or errors, including all four PR cases and all five RocketMQ execution cases. The existing opt-in structured-output race case requires agentscope.runStructuredOutputRaceTest, which was not enabled. Spotless checks and affected-module compilation pass. These Windows checks are not proof of Linux recovery or a full-repository/full-module test result.

Previous checks on base a4306d6: targeted Core clean verify passed (29 cases / 28 passed / 1 existing skip), including Javadoc/packaging. Docs npm ci --ignore-scripts, npm test (20 passed) and npm run validate passed; broken-links exited 1 on both patch and baseline with 2750 links / 483 files, all 3233 ordered file/target entries identical. The documentation tree, its lockfile and the three contribution files are unchanged by the latest upstream merge, so those checks were not needlessly repeated.

The historical controlled mutation on main 874c9cb restored the old default-model guard and caused both mismatch cases to fail (2 failures / 4 cases / zero errors); matching controls passed, and the file was restored in finally. This is historical regression evidence, not a claim that current upstream is defective.

git diff 30dc84b5 --check passes; history is preserved with normal merges and pushes, never force-pushed. Offline fakes only; no coverage percentage or completed remote CI is claimed. AI assistance was used for investigation, testing and complete contribution-diff review.

Checklist

  • Regression formatted; Spotless checks pass.
  • Four-case matrix, related Core cases and RocketMQ cases pass (existing skip disclosed).
  • No production-code changes against current main.
  • Matching EN/ZH dev notes validated; unchanged in this refresh.
  • Contribution diff reviewed; waiting for updated-head CI and maintainer review.

Copilot AI balanced review requested due to automatic review settings November 4, 2026 00:18
@mintlify

mintlify Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit 8ca4373.

Approve preview

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. Review the Copilot code review billing settings.

@pengmoubuaixuexi

Copy link
Copy Markdown
Contributor Author

CI follow-up for a36b848:

I checked both failed build logs. The four new ReActAgentPerCallStructuredToolChoiceTest cases passed on both platforms, and the Core module passed on both platforms (2,982 tests, zero failures/errors; 9 skipped on Ubuntu and 8 on Windows).

The failures were in existing Harness tests:

  • Ubuntu: InboxMiddlewareTest.notificationReachesModelRequestUnderRealScheduling (line 308). The assertion captured a memory-consolidation request rather than the expected notification request.
  • Windows: HarnessAgentSubagentStreamEventsTest.streamEvents_sameTypeSubagentInstancesGetDistinctSources (line 297), expecting two child starts but observing one.

I reran the full two affected test classes together with the new regression class on the unchanged PR head locally (Windows, Java 17): 21 tests passed, zero failures/errors, with Spotless checks passing:

mvn -B -T1C -pl :agentscope-harness -am -Dtest=ReActAgentPerCallStructuredToolChoiceTest,InboxMiddlewareTest,HarnessAgentSubagentStreamEventsTest -Dsurefire.failIfNoSpecifiedTests=false test

This targeted pass does not establish the cause of the CI failures or replace a green full build. No assertions were weakened, tests excluded, or code changed for this follow-up. Could a maintainer rerun the failed jobs to check whether these failures recur? If they do, the scheduling/background-call interaction warrants further investigation.

Investigation and this comment were prepared with AI assistance.

@jujn jujn added the P1 紧急不重要 label Nov 7, 2026
@pengmoubuaixuexi pengmoubuaixuexi changed the title fix(core): use the selected model for structured retry tool choice test(core): cover pinned-model structured retry capabilities Nov 11, 2026
@pengmoubuaixuexi

Copy link
Copy Markdown
Contributor Author

Upstream #3965 now contains the production correction reported in #3959. I merged current main into this branch, resolved the outdated modelId documentation conflicts, and migrated the regression to RuntimeContext.put(Model.class, selected). The PR now has no production-code diff against main: it supplies the four default/pinned-model capability combinations plus EN/ZH contract notes.

The two mismatched-capability cases fail if the former default-model guard is restored (4 cases / 2 failures on the controlled mutation); both matching controls pass. On the refreshed branch, the new four cases and related targeted Core checks pass: 29 cases, 28 passed, one existing opt-in race case skipped, zero failures/errors. Spotless, Javadoc, packaging and docs validation passed; broken-link targets are identical to the latest main baseline.

History is preserved with a normal merge/push, and the title/description now reflect the regression-only contribution. The previous failed jobs belong to the older head; CI for 58201bb must finish before any green-CI claim.

@pengmoubuaixuexi

Copy link
Copy Markdown
Contributor Author

Merged latest main a4306d6 without force-pushing and resolved the docs conflict. Stable v2 context pages now match upstream exactly; the two contract notes live in dev docs. The four-case regression is unchanged and this remains a regression-only contribution (three files, no production diff).

Fresh targeted Core clean verify: 29 cases / 28 passed / 1 existing opt-in skip / zero failures or errors; all four new cases pass. Docs: 20 tests and validate pass; broken-link targets exactly match the same upstream baseline (2750 links / 483 files). New head cfb7c7b is starting CI; the former green jobs are not the result for this head.

@pengmoubuaixuexi

Copy link
Copy Markdown
Contributor Author

CI follow-up for head cfb7c7b: Windows passed, while Ubuntu failed in the upstream RocketMqExecutionTest.agentScopeResumesThroughSeparateLedgersDespitePublicationAndAckFailures at line 403 (the 10-second wait for TurnStatus.SUCCEEDED). The four cases added by this PR all passed in that same Ubuntu log.

I ran the unchanged five-case RocketMqExecutionTest locally on this exact head with mvn -B -T1C -pl :agentscope-extensions-durable-rocketmq -am -Dtest=RocketMqExecutionTest -Dsurefire.failIfNoSpecifiedTests=false test: 5 passed, 0 skipped/failures/errors (Windows/Java 17). This is not a Linux reproduction or proof of the timeout cause, and I have not weakened assertions, increased timeouts, or changed the MQ implementation.

Could a maintainer rerun the failed Ubuntu job? The rerun API rejects my account with 403 / repository admin rights required. No additional code commit was pushed merely to retrigger CI.

@pengmoubuaixuexi

Copy link
Copy Markdown
Contributor Author

Merged upstream main 30dc84b normally, including #4176 and its RocketMQ fake-broker recovery-test correction. The PR contribution remains the same four-case regression and EN/ZH dev notes: no production diff against current main. The upstream correction is not claimed as my own fix.

Local targeted verification on the refreshed branch: 34 cases / 33 passed / 1 existing opt-in skip / zero failures or errors; all four new cases and all five RocketMQ execution cases pass. Documentation and its lockfile are unchanged since the previously passing validation.

This supersedes my request to rerun the old cfb7c7b Ubuntu job. New head 8ca4373 is starting fresh CI; Windows-only local verification does not establish that the Linux failure is resolved. No force push or empty trigger commit was used.

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

P1 紧急不重要

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants