SEZ9 opened a new pull request, #13000:
URL: https://github.com/apache/seatunnel/pull/13000
### Purpose of this pull request
Closes part 1 of #12999.
A clarifying question splits one requirement across two turns, but only the
planner reads the conversation history. Skill matching, slot filling and the
enriched prompt are all built from the latest message alone, so the reply
replaced the requirement instead of adding to it.
The benchmark shows the effect plainly. After a question it replies
```
Use sensible defaults for anything unspecified. Do not ask further questions
- generate the config now.
```
and that string became the entire `## User Request` the generator saw — no
source, no sink, no table name. The plan derived from it is empty, and an empty
plan yields an empty connector-metadata block, so the generator ends up
recalling option keys from memory, which is the one thing the retrieved option
rules exist to prevent.
`Orchestrator.pending_question` was already declared but never assigned or
read, so the continuation it implies was never wired up. It now records the
outstanding question, and the requirement is accumulated across rounds and
cleared once a config or a chat reply is delivered.
A message arriving while a question is outstanding is treated as an answer
to it. There is no reliable way to distinguish an answer from an unrelated new
request, and merging is the safer default: the planner reads the whole history
regardless, so the alternative loses the requirement outright. This is noted in
the code.
### Does this PR introduce _any_ user-facing change?
Yes, and it is the point of the change.
Before, answering a clarifying question discarded what you had originally
asked for. A session like
```
> Sync the users table from MySQL at localhost:3306, database shop, user root
into the existing users_replica table in the same database.
< I need a few more details to generate the config:
- job mode
> Batch is fine.
```
generated from `Batch is fine.` alone.
After, the generator receives both turns:
```
Sync the users table from MySQL at localhost:3306, database shop, user root
into the existing users_replica table in the same database.
Additional details, in reply to a clarifying question:
Batch is fine.
```
No configuration, no API and no command-line surface changes.
### How was this patch tested?
New `seatunnel-cli/tests/test_orchestrator_clarification.py`, 6 tests: the
merge itself, accumulation across several rounds, the reset after a config is
delivered, that a question records the pending state, and end to end over
`process_user_input` that the generator still sees the original request.
The last one is the regression guard. Reverting just the three call sites
back to `user_input` makes it fail with the reply as the whole request:
```
AssertionError: 'users_replica' not found in 'Use sensible defaults for
anything
unspecified. Do not ask further questions - generate the config now.'
```
Full CLI suite: `341 passed, 3 subtests passed`.
Not run: the 12-task `--preset smoke` benchmark, which needs a live engine
and an LLM provider. This change is in orchestration control flow and is
covered by unit tests at that level; I did not want to claim a benchmark result
I had not produced.
### Stacking
This is the base of three PRs for #12999. The other two build on it — part 3
in particular uses the `_original_request` state introduced here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]