SEZ9 opened a new pull request, #13152:
URL: https://github.com/apache/seatunnel/pull/13152

   ### Purpose of this pull request
   
   Closes #13151.
   
   A clarifying question can repeat without limit. Neither question exit in 
`process_user_input` counted rounds, so a planner that keeps failing to resolve 
a pipeline and a caller that keeps answering produce an endless exchange.
   
   Since #13000 each reply is accumulated onto the requirement rather than 
replacing it — which is correct, the requirement has to survive the question — 
so an unbounded loop is also unbounded growth. Every round appends the new 
message to the text sent to the model.
   
   Both exits now route through one `_ask` helper that counts. The count cannot 
be forgotten by one of them, and a future third exit inherits the bound instead 
of reintroducing the loop. After three rounds it returns an error naming the 
two facts only the user has, and clears the exchange.
   
   Three rounds matches the budget the validate/fix loop already uses, so the 
class has one retry number rather than two a reader has to remember.
   
   Giving up rather than generating anyway is the deliberate part. A config 
invented without a source and a destination still parses, still loads its 
plugins and still runs, so static check, dry-run and execution all pass it — 
the CLI would report success for a job moving the wrong data. That is the error 
class the gates cannot see, so it has to be stopped here.
   
   The three existing reset points are routed through a `_reset_exchange` 
helper, so the new counter is cleared everywhere the requirement already was.
   
   Not based on #13001: the loop exists on `dev` today through the missing-slot 
question, independently of the empty-plan guard that PR adds. This branch is 
cut from `dev` and does not depend on it.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, in the case that previously did not terminate.
   
   Before, a request the planner could not resolve produced the same question 
every round, forever for a programmatic caller.
   
   After, the fourth attempt stops:
   
   ```
   I asked 3 times and still cannot work out the data flow, so I am stopping
   rather than guessing.
   
   To generate a config I need at least:
   - the source: which system, and how to reach it (host, port, database, table)
   - the destination: the same again, or where the output should go
   
   The last thing I asked was:
   Which database?
   ```
   
   An exchange that resolves within three rounds is unaffected, and so is every 
request that needs no clarification. No configuration, API or command-line 
surface changes.
   
   ### How was this patch tested?
   
   New `seatunnel-cli/tests/test_orchestrator_clarification_rounds.py`, 8 tests.
   
   Five cover the bound: the first three rounds still ask, the fourth gives up, 
the message names the source and the destination and quotes the last question, 
the exchange and counter are cleared, and the accumulated requirement stops 
growing.
   
   Three cover the reset, because a count left behind would give the next 
unrelated request fewer clarifications than it deserves: a delivered config, a 
chat reply, and a session resume.
   
   Removing the bound turns four of them red:
   
   ```
   FAILED test_the_next_round_gives_up_instead_of_asking_again
   FAILED test_giving_up_says_what_is_actually_needed
   FAILED test_giving_up_clears_the_exchange
   FAILED test_the_requirement_stops_growing_once_we_give_up
   ```
   
   Full suite from `seatunnel-cli/`: 354 passed, 3 subtests passed.
   
   Not run: the 12-task `--preset smoke` benchmark, which needs a live engine 
and an LLM provider. Stated rather than skipped silently.
   


-- 
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]

Reply via email to