Repository navigation
fix(store): include SQL diagnostics in conditional write failures - #3954
Open
wenwenwu999-maker wants to merge 2 commits into
Open
wenwenwu999-maker wants to merge 2 commits into
wenwenwu999-maker wants to merge 2 commits into
Conversation
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
wenwenwu999-maker
force-pushed
the
fix/3948-store-sql-diagnostics
branch
from
November 3, 2026 11:22
fdd4667 to
eb50a90
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AgentScope-Java Version
2.1.0-SNAPSHOT, based on main at 4af86c5.
Description
Fixes #3948.
When a conditional store write fails with a database error, the top-level exception currently only identifies the store and insert/update operation. Callers that report just the exception message lose the diagnostic SQLState and database message, even though the original SQLException is already retained as the cause.
Include both fields in the failure messages for insert and update paths in the unified JDBC store and the legacy MySQL and PostgreSQL stores. Preserve the original cause, message prefix, and duplicate-key/CAS behavior. Update the English and Chinese JDBC documentation.
Add regression coverage for both paths with data-length, missing-table, missing-column, connection, serialization, and null SQLStates, plus successful writes and duplicate inserts. Tests use mocked JDBC objects and require no database service or provider credentials.
Validation on Windows with JDK 21 (Java release 17 target):
-Dtestin a-pl ... -am testreactor build to avoid running unrelated prerequisite test suites. JDBC's opt-in Testcontainers integration profile was not enabled.spotless:applyand the default Spotless checks in the test build passed;git diff --checkpassed.npm testtests andnpm run validatepassed.mvn -B -T1C clean verifywas attempted. It failed in the unchanged coreDangerousPathBypassTest.symlinkToSshIsDetectedandsymlinkToDotEnvIsDetectedtests because this Windows account lacks symbolic-link privileges. Core reported 2,968 tests, zero assertion failures, two errors, nine skips. No assertions or tests were weakened or disabled in the repository.npm run broken-linksreported 2,224 broken links in 328 files. Re-running with both edited documents restored to HEAD produced byte-for-byte identical normalized diagnostics. The two new paragraphs contain no new links.AI assistance: OpenAI Codex assisted with investigation, implementation, and validation.
Checklist
mvn spotless:applymvn test)Windows CI follow-up
The Windows run failed in the existing
HarnessAgentSubagentStreamEventsTest.streamEvents_sameTypeSubagentInstancesGetDistinctSources: it observed one child-start event instead of two. This is separate from the local Windows symbolic-link privilege limitation noted above.The test scripts six sequential responses on a model shared by the parent and spawned children. Default background memory extraction also calls that model and can consume responses intended for the next conversation turn. A controlled diagnostic run observed ten calls, including four memory-extraction calls; disabling memory hooks for this test restored exactly six conversation calls.
Disable memory hooks only in this multi-instance event test. Keep all existing source/session assertions and additionally require one child start in each turn and exactly six scripted model calls. Production behavior and CI configuration are unchanged.
Validation on Windows/JDK 21:
@Testannotation afterward.mvn -B -T1C -pl agentscope-harness -am test "-Dtest=**/harness/**" "-Dsurefire.failIfNoSpecifiedTests=false": 1,595 tests, zero failures/errors, 37 existing skips; the affected event test class passed all six tests.git diff --checkpassed. Temporary diagnostic prints and background-task waits were removed.The new push triggers a fresh CI run; its final outcome is recorded in GitHub Checks.