Skip to content

fix: headless/non-interactive Rdx for bots (cast + empty output file) - #88

Open
crl33 wants to merge 1 commit into
Decimation:v4from
crl33:fix/headless-noninteractive-output
Open

fix: headless/non-interactive Rdx for bots (cast + empty output file)#88
crl33 wants to merge 1 commit into
Decimation:v4from
crl33:fix/headless-noninteractive-output

Conversation

@crl33

@crl33 crl33 commented Jul 31, 2026

Copy link
Copy Markdown

Summary

Fixes three bugs that make SmartImage.Rdx unusable as a headless server backend (Telegram bots, Docker, CI):

  1. InvalidCastException after upload in non-interactive mode: (IRenderable[]) list where list is IList<IRenderable> / List from GetMainRows.
  2. Empty --output-file: WriteOutputFile only walks m_dialogs, which was only populated when Interactive was true.
  3. Empty redirected stdin crash in ParseInputStream (buffer2[-1]), and ConfirmAsync hanging/crashing on error when stdin is DEVNULL.

Test plan

  • SmartImage photo.jpg -e SauceNao -u Catbox -f Delimited -o out.tsv --interactive false --keep-open false </dev/null
  • Expect exit without Spectre cast crash; out.tsv has header + rows when matches exist
  • Interactive mode still behaves as before

Used by crl33/ReverseImageSearching Telegram bot behind BotDashboard.

Non-interactive mode crashed after upload with InvalidCastException because
GetFullRows yields List<IRenderable>, not IRenderable[]. Also:

- Always record results in m_dialogs so --output-file is not empty
- Guard empty redirected stdin (DEVNULL IndexOutOfRange)
- Skip "Press any key" when stdin is redirected
- Skip CanvasImage preview when not interactive

Enables Docker/Telegram bots that call SmartImage with --interactive false
and a delimited results file.
@Decimation

Copy link
Copy Markdown
Owner

Thanks for the PR. I'm reviewing it.

Used by crl33/ReverseImageSearching Telegram bot behind BotDashboard.

This repo doesn't exist?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants