det101 opened a new issue, #12544:
URL: https://github.com/apache/seatunnel/issues/12544

   ### Search before asking
   
   - [x] I had searched in the 
[feature](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22Feature%22)
 and found no similar feature requirement.
   
   ### Description
   
   SeaTunnel CLI currently has weak observability when config generation 
**soft-fails**.
   
   Typical case: the planner/generator stages succeed, then the validator/fix 
loop fails repeatedly, and the user only sees a short message such as:
   
   ```text
   Failed to generate config.
   ```
   
   or stage lines without the underlying reason:
   
   ```text
   stage=validator outcome=fail round=1
   stage=fix outcome=ok round=1
   stage=validator outcome=fail round=2
   ```
   
   Exceptions already print a traceback, but soft failures (empty model reply, 
missing HOCON code block, local/LLM validation FAIL) do **not** expose:
   
   - which pipeline stage failed (`start` → `planner` → `skill` → `metadata` → 
`generator` → `validator` → `fix` → `dryrun` → `result`)
   - local `validate_hocon` vs LLM validator verdict
   - a redacted snippet of the model / validator output
   
   Please add an **opt-in** debug mode for the agent pipeline:
   
   1. CLI flag: `--debug`
   2. Env var: `SEATUNNEL_CLI_DEBUG=1` (equivalent)
   3. Default behavior unchanged (no noisy logs)
   4. When enabled, print a one-line summary per stage; on failure attach a 
**redacted, truncated** detail block
   5. Soft-failure user message should include a short reason code (e.g. 
`no_hocon_block`) plus a hint to re-run with `--debug`
   6. Never print API keys / passwords (reuse / align with existing secret 
redaction)
   
   This is a diagnostics improvement, not a change to generation prompts by 
itself. It helps contributors and users locate whether failures come from the 
model, parsing, local validation, or the LLM validator loop.
   
   ### Usage Scenario
   
   - Debugging why `seatunnel` / `seatunnel --debug` fails to produce a config 
with a given LLM provider/gateway
   - Distinguishing “model returned no HOCON block” vs “validator rejected 
`${ENV}` placeholders” vs tool-loop exhaustion
   - Supporting issue reports with a shareable (redacted) stage trace
   
   Example (desired):
   
   ```bash
   seatunnel --debug
   # or
   SEATUNNEL_CLI_DEBUG=1 seatunnel
   ```
   
   ```text
   [debug] stage=start provider=openai model=... fast_model=...
   [debug] stage=planner stop_reason=end_turn tools=0 outcome=plan
   [debug] stage=generator outcome=ok
   [debug] stage=validator_detail local=fail reason=INVALID
   [debug] detail:
   | ERROR: Unresolved environment variables: MYSQL_USER, MYSQL_PASSWORD
   [debug] stage=validator round=1 outcome=fail reason=...
   ```
   
   ### Related Issues
   
   - N/A (no existing CLI debug/diagnostics feature request found)
   - Follow-up (out of scope for this issue): whether unresolved `${ENV}` 
placeholders should be WARNING during generation vs ERROR only at `/run` — can 
be a separate issue after debug lands
   
   ### Are you willing to submit a PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   
   ---
   
   (中文补充)CLI 在软失败时几乎看不到原因(例如校验器因未 export 的 `${MYSQL_USER}` 判 INVALID 导致反复 
fix)。希望增加可选的 `--debug` / `SEATUNNEL_CLI_DEBUG`,按 Agent 
全链路打印阶段结果,并在失败时输出脱敏详情,方便排查与提高后续修复效率。


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