Repository navigation
Conversation
SemanticConsistencyNode#buildValidationResult passed the model's reason
straight into SqlRetryDto.semantic(). A response of {"passed":false}
without a "reason" field therefore stored a null reason, which then
reaches SqlGenerationDTO.exceptionMessage and is rendered into the
{error_message} section of the sql-error-fixer prompt — leaving the
repair model with an empty "错误信息" block and nothing to act on.
Fall back to a generic notice when the reason is blank so the retry
prompt always carries an explanation. Behaviour is unchanged whenever
the model supplies a reason.
Add a regression test asserting the stored reason is never null while
the failure verdict and retry routing are preserved.
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.
What this PR does / why we need it
SemanticConsistencyNode#buildValidationResultforwarded the model's reason straight into the retry state:SemanticConsistencyOutputDTO#reasonis an optional field — a response of{"passed":false}with noreasonis entirely legal for a model to emit. In that case the node storedSqlRetryDto(null, true, false).That null then travels the full retry path:
so the repair model receives an empty
错误信息section and is asked to fix a SQL statement with no stated reason. It has to guess, which is exactly the kind of silent quality loss that is hard to attribute later.Root cause
reasonis treated as always-present when it is an optional model output field. The same class of defect was fixed forSqlExecuteNodein a companion PR (there the null leaked into the literal user-facing stringSQL执行失败: null); here it leaks into the prompt instead.The fix
Fall back to a generic notice when the reason is blank:
passed=false) and the retry routing (semanticFail=true) are untouched, so the workflow still loops back toSqlGenerateNode.org.apache.commons.lang3.StringUtilsis the same utility already used across the workflow nodes; one import added.How to verify
RED (before the fix)
mvn -o -pl data-agent-management -am -Dtest=SemanticConsistencyNodeTest -Dsurefire.failIfNoSpecifiedTests=false testThe test drives the real node with a genuine
{"passed":false}model response (no mocking ofBeanOutputConverter), so the null comes from the production path.GREEN (after the fix)
Same command →
Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, BUILD SUCCESS.Full module
mvn -o -pl data-agent-management -am -Dspotless.apply.skip=true testThe 6 failures (
PromptHelperTest4,NodeTracingLifecycleListenerTest1,PlannerNodeTest1) are pre-existing on upstreammain— isolated by reverting to the upstream versions of the touched files and re-running those three suites. The count is 1714 rather than 1712 because two open PRs of mine each add one test; on this branch alone the delta is +1.mvn -o -pl data-agent-management -am -Dspotless.apply.skip=true checkstyle:check→You have 0 Checkstyle violations. BUILD SUCCESS.Special notes for reviews
SqlUtil.findGeneratedSqlValidationErrorstructural failures already pass a non-null reason, so the structural path is unaffected.SqlExecuteNode'se.getMessage()handling is fixed in a separate PR (fix(sql-execute): fall back to exception type when error message is null #634) so each change stays reviewable on its own.