You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "det101 (via GitHub)" <gi...@apache.org> on 2026/09/29 03:29:35 UTC

[I] [Improve][CLI] Add opt-in --debug pipeline diagnostics for soft generation failures [seatunnel]

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: commits-unsubscribe@seatunnel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Improve][CLI] Add opt-in --debug pipeline diagnostics for soft generation failures [seatunnel]

Posted by "KaustAbhinand (via GitHub)" <gi...@apache.org>.
KaustAbhinand commented on issue #12544:
URL: https://github.com/apache/seatunnel/issues/12544#issuecomment-6160703274

   Hi @SEZ9
   I could reproduce the fixes of the PR, if needed


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Improve][CLI] Add opt-in --debug pipeline diagnostics for soft generation failures [seatunnel]

Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on issue #12544:
URL: https://github.com/apache/seatunnel/issues/12544#issuecomment-6182876679

   Hi @KaustAbhinand, thanks for offering to help — you're welcome to pick this up.
   
   To recap the scope: an opt-in `--debug` flag (and/or `SEATUNNEL_CLI_DEBUG=1` env var) for the LLM-based CLI config-generation pipeline that prints a short per-stage summary as it runs, prints failure details with secrets redacted, and attaches a reason code to each soft failure so users can see why a stage degraded. Debug output should stay off by default so normal CLI output is unchanged.
   
   Could you clarify which PR you mean by "reproduce the fixes of the PR"? If you have one in mind, please link it here. Otherwise, feel free to open a PR for this work; a brief outline of the reason codes you plan to introduce and where redaction will happen would help us align early. In the PR, sample output for one successful run and one soft-failure run with `--debug` enabled, plus a test showing nothing extra is printed when debug is off, would be great. Ping when it's up and we'll take a look.
   
   <!-- streview-comment:1755 -->


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Improve][CLI] Add opt-in --debug pipeline diagnostics for soft generation failures [seatunnel]

Posted by "KaustAbhinand (via GitHub)" <gi...@apache.org>.
KaustAbhinand commented on issue #12544:
URL: https://github.com/apache/seatunnel/issues/12544#issuecomment-6152337737

   Hi is this issue resolved? If not, I would like to complete it


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Improve][CLI] Add opt-in --debug pipeline diagnostics for soft generation failures [seatunnel]

Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on issue #12544:
URL: https://github.com/apache/seatunnel/issues/12544#issuecomment-6160503477

   Thanks for the detailed proposal. The scope looks reasonable: opt-in via `--debug` / `SEATUNNEL_CLI_DEBUG=1`, default output unchanged, one-line stage summaries with a redacted, truncated detail block on failure, and a short reason code (e.g. `no_hocon_block`) in the soft-failure message.
   
   A couple of things that would help before a PR:
   
   - Which SeaTunnel version/branch are you working against, and where does this CLI agent pipeline live? That will help find reviewers and confirm which existing secret-redaction logic to reuse.
   - If possible, share one real redacted example of the current output vs. the desired `--debug` output for a soft-failure case, so the expected format is clear.
   
   Since you've indicated you're willing to submit a PR, feel free to go ahead. Please include unit tests covering redaction and truncation of the detail block.
   
   @KaustAbhinand thanks for offering to help as well — the issue author has already volunteered to submit a PR, so please coordinate with them here before starting work to avoid duplicate effort.
   
   <!-- streview-comment:1747 -->


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org