Text chat 21: apps/fluxer text chat runtime wiring (#271) #368

Manually merged
charles merged 3 commits from textchat-21-app-textchat-runtime into textchat 2026-11-13 02:14:20 +00:00
Owner

What this builds

  • Every text chat ApiRequest is executed (runtime::perform_chat): rich sends and edits (now in the ordered write queue), manual ack, attachment delete and URL refresh, reactions and reactors, pins, search (retried like a GET), bookmarks and mentions, group DMs, relationships, user settings, GIFs, saved media, guild emoji and stickers, threads. Before this they all failed with 501.
  • Effect::Upload → apps/fluxer/src/upload_rt.rs: one task per job. Multipart (send_message_with_files) or presigned (presign, PUT per singlepart file or per part with 4 parts at once, 4 attempts, 500 ms doubling to 8000 ms; complete for multipart uploads; then the send with upload_filename/file_size/content_type). Progress is throttled to 100 ms and always reports the end. UploadCommand::Cancel aborts the task (the body stream is dropped); a session change aborts every job. Files are read through UploadReader (default FileReader: paths in 1 MiB chunks through fluxer_platform::upload_files, FileSource::Clipboard from PastedImages, FileSource::Text as UTF-8). Runtime::with_upload_reader is for tests.
  • Effect::Clipboard / Effect::OpenFileDialog → apps/fluxer/src/desktop_rt.rs (Desktop, Runtime::with_desktop): text goes to the window through window_clipboard() and the window writes it with iced's clipboard; images are downloaded and written with ClipboardImages (ArboardClipboard); Attach/GroupIcon open dialogs come back as CoreEvent::Files with fresh FileRef ids (Desktop::file_id); SaveAttachment opens the save dialog, downloads and writes the file.
  • main.rs builds the Desktop (RfdDialogs, ArboardClipboard, the window clipboard) and passes the dialogs, clipboard images and copy receiver into fluxer_ui::run.
  • --record: the query (signature ex/is/hm/uc) of a signed attachment URL is replaced by <redacted> wherever it appears. Upload exchanges were already hidden from the observer, and upload_url is already a secret key.

How it was tested

  • apps/fluxer/tests/textchat_runtime.rs (devserver textchat / textchat_presigned): send_with_two_files_multipart_progress_and_done (progress total = both files, the bytes downloaded back match), presigned_scenario_uploads_parts (21 MiB file = 3 parts plus a singlepart file, reassembled bytes match), cancel_aborts_upload (a reader that stalls after the first chunk; Cancel drops the body, no Done/Failed, no message), react_round_trip_through_gateway (PUT, then the gateway echo, counted once), search_indexing_then_results ({indexing:true}, then results), record_mode_never_contains_upload_or_signed_urls, clipboard_text_effect_executes (fake TextClipboard, "Copy ID pair").
  • Unit tests: progress throttle, pasted images, reader errors that leave the path out, retry rules (upload_rt); dialogs answered with FileRefs with unique ids and no path in Debug, a cancelled dialog reports nothing, window clipboard (desktop_rt); signed URL redaction (record).
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green locally (Linux). No real-desktop test was added: the platform's real dialog and clipboard tests are Text chat 7's.

Deviations from the plan

  • crates/fluxer-ui touched (app.rs, message.rs, README): run takes clipboard: Option<Arc<dyn ClipboardImages>> and copied: Option<UnboundedReceiver<String>>. The plan says the runtime injects them into fluxer_ui::run, and text has to go through iced's clipboard, which only the window can reach. The clipboard field is unused until the composer's paste (Text chat 26, #365).
  • play_audio_attachment_reaches_mixer is not in the test file. The store does not play attachments before Text chat 16 (chat/media.rs is a stub). An #[ignore]d test fails CI, because the Linux step runs ignored tests. Follow-up #364 also covers the 30 s / 20 MiB clip limit (so crates/fluxer-audio/src/clip.rs is unchanged) and the 32 MiB fetch_media cap for "Save".
  • search_indexing_then_results calls fluxer::runtime::perform_chat directly (it is public and #[doc(hidden)]), because the store's search is a stub until Text chat 17.
  • ApiRequest::DeleteRecentMention still fails with 501 because fluxer-api has no endpoint for it (#362). ApiResult::TypingCooldown is not mapped because ApiClient::typing discards the 200 body (#363).
  • New futures-util dependency in apps/fluxer (already a workspace dependency), for reading a file part by part.

Closes #271

🤖 Generated with Claude Code

## What this builds - **Every text chat `ApiRequest`** is executed (`runtime::perform_chat`): rich sends and edits (now in the ordered write queue), manual ack, attachment delete and URL refresh, reactions and reactors, pins, search (retried like a GET), bookmarks and mentions, group DMs, relationships, user settings, GIFs, saved media, guild emoji and stickers, threads. Before this they all failed with 501. - **`Effect::Upload`** → `apps/fluxer/src/upload_rt.rs`: one task per job. Multipart (`send_message_with_files`) or presigned (presign, `PUT` per singlepart file or per part with 4 parts at once, 4 attempts, 500 ms doubling to 8000 ms; `complete` for multipart uploads; then the send with `upload_filename`/`file_size`/`content_type`). Progress is throttled to 100 ms and always reports the end. `UploadCommand::Cancel` aborts the task (the body stream is dropped); a session change aborts every job. Files are read through `UploadReader` (default `FileReader`: paths in 1 MiB chunks through `fluxer_platform::upload_files`, `FileSource::Clipboard` from `PastedImages`, `FileSource::Text` as UTF-8). `Runtime::with_upload_reader` is for tests. - **`Effect::Clipboard` / `Effect::OpenFileDialog`** → `apps/fluxer/src/desktop_rt.rs` (`Desktop`, `Runtime::with_desktop`): text goes to the window through `window_clipboard()` and the window writes it with iced's clipboard; images are downloaded and written with `ClipboardImages` (`ArboardClipboard`); Attach/GroupIcon open dialogs come back as `CoreEvent::Files` with fresh `FileRef` ids (`Desktop::file_id`); SaveAttachment opens the save dialog, downloads and writes the file. - **`main.rs`** builds the `Desktop` (`RfdDialogs`, `ArboardClipboard`, the window clipboard) and passes the dialogs, clipboard images and copy receiver into `fluxer_ui::run`. - **`--record`**: the query (signature `ex`/`is`/`hm`/`uc`) of a signed attachment URL is replaced by `<redacted>` wherever it appears. Upload exchanges were already hidden from the observer, and `upload_url` is already a secret key. ## How it was tested - `apps/fluxer/tests/textchat_runtime.rs` (devserver `textchat` / `textchat_presigned`): `send_with_two_files_multipart_progress_and_done` (progress total = both files, the bytes downloaded back match), `presigned_scenario_uploads_parts` (21 MiB file = 3 parts plus a singlepart file, reassembled bytes match), `cancel_aborts_upload` (a reader that stalls after the first chunk; Cancel drops the body, no Done/Failed, no message), `react_round_trip_through_gateway` (PUT, then the gateway echo, counted once), `search_indexing_then_results` (`{indexing:true}`, then results), `record_mode_never_contains_upload_or_signed_urls`, `clipboard_text_effect_executes` (fake `TextClipboard`, "Copy ID pair"). - Unit tests: progress throttle, pasted images, reader errors that leave the path out, retry rules (`upload_rt`); dialogs answered with `FileRef`s with unique ids and no path in `Debug`, a cancelled dialog reports nothing, window clipboard (`desktop_rt`); signed URL redaction (`record`). - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green locally (Linux). No real-desktop test was added: the platform's real dialog and clipboard tests are Text chat 7's. ## Deviations from the plan - **`crates/fluxer-ui` touched** (`app.rs`, `message.rs`, README): `run` takes `clipboard: Option<Arc<dyn ClipboardImages>>` and `copied: Option<UnboundedReceiver<String>>`. The plan says the runtime injects them into `fluxer_ui::run`, and text has to go through iced's clipboard, which only the window can reach. The `clipboard` field is unused until the composer's paste (Text chat 26, #365). - **`play_audio_attachment_reaches_mixer` is not in the test file.** The store does not play attachments before Text chat 16 (`chat/media.rs` is a stub). An `#[ignore]`d test fails CI, because the Linux step runs ignored tests. Follow-up #364 also covers the 30 s / 20 MiB clip limit (so `crates/fluxer-audio/src/clip.rs` is unchanged) and the 32 MiB `fetch_media` cap for "Save". - **`search_indexing_then_results` calls `fluxer::runtime::perform_chat` directly** (it is public and `#[doc(hidden)]`), because the store's search is a stub until Text chat 17. - **`ApiRequest::DeleteRecentMention`** still fails with 501 because `fluxer-api` has no endpoint for it (#362). **`ApiResult::TypingCooldown`** is not mapped because `ApiClient::typing` discards the 200 body (#363). - New `futures-util` dependency in `apps/fluxer` (already a workspace dependency), for reading a file part by part. Closes #271 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Executes every text chat ApiRequest through fluxer-api (perform_chat),
Effect::Upload (upload_rt: multipart with progress throttled to 100 ms,
or presigned with 4 parallel parts, 4 attempts, 500-8000 ms backoff;
cancellation), Effect::Clipboard and Effect::OpenFileDialog (desktop_rt:
text through the window's iced clipboard, images through
ClipboardImages, dialogs answered with CoreEvent::Files, save dialog then
download). Injects the dialogs and clipboard images into fluxer_ui::run;
--record strips the signature of signed attachment URLs.

Refs #271

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Note from the review of PR #350 (Text chat 19): fluxer-core there adds ApiRequest::EditGroupDmIcon { channel_id, name, icon: FileRef } (group DM icon, sent as a data URI). The chat request match in apps/fluxer/src/runtime.rs here ends in _ => return Err(not_a_chat_request()), so once both merge, setting a group DM icon answers 501 CLIENT_NOT_WIRED. Tracked as follow-up #372.

Note from the review of PR #350 (Text chat 19): `fluxer-core` there adds `ApiRequest::EditGroupDmIcon { channel_id, name, icon: FileRef }` (group DM icon, sent as a data URI). The chat request match in `apps/fluxer/src/runtime.rs` here ends in `_ => return Err(not_a_chat_request())`, so once both merge, setting a group DM icon answers 501 CLIENT_NOT_WIRED. Tracked as follow-up #372.
Author
Owner

Review: Text chat 21 (app-textchat-runtime), independent reviewer

Reviewed git diff 173ee747..origin/textchat-21-app-textchat-runtime (b09adbe) cold.

Findings

1. BLOCKING: signed attachment URLs reach the log files (apps/fluxer/src/desktop_rt.rs:156-160 and :202).
ClipboardWrite::Image and FileDialog::SaveAttachment call client.fetch_media(&url) and on failure log tracing::warn!(%error, …). fetch_media (fluxer-api/src/soundboard.rs fetch_capped) turns send()/chunk() failures into ApiError::Transport(reqwest::Error) with the URL. ApiError's Display is transport error: {0}, and reqwest 0.12.28's Display appends for url ({url}) (reqwest/src/error.rs:267-268). A DNS, connect, TLS, timeout or mid-body failure while saving or copying an attachment therefore writes …/attachments/…?ex=…&is=…&hm=… at warn into fluxer.<date>.log. That breaks the Global Constraint "No … signed attachment URL … in logs" and Review Focus 5, which is this task's. (runtime::core_error already strips the URL with without_url(); desktop_rt skips that step.) Fix: log error after mapping ApiError::Transport(e) to e.without_url(), or log only a kind/status. Add a unit test: point fetch_media at an unroutable signed URL and assert that the logged/Display text holds no hm=.

2. Minor: the signed-URL check in record_mode_never_contains_upload_or_signed_urls tests nothing (apps/fluxer/tests/textchat_runtime.rs:515-518). The devserver never signs attachment URLs (no ex=/hm= anywhere in crates/fluxer-devserver/src), so !content.contains("hm=") cannot fail. The unit test record::signed_attachment_urls_lose_their_signature does cover the redaction. Either make the devserver sign /media/attachments/ URLs or note in the test that the check only guards against regressions.

3. Minor: plan items deferred, each with a follow-up. play_audio_attachment_reaches_mixer is missing and PlaybackSource::Attachment is not executed: the variant is not on the base yet, although it is in Text chat 10's Produces list (#364). The SaveAttachment download is capped at MAX_MEDIA_BYTES = 32 MiB, while spec §8 says to raise it to the instance's attachment limit (#364). On that failure the user sees nothing, only a warn. DeleteRecentMention still returns 501 (#362) and TypingCooldown is not produced (#363). These are acceptable as deferrals.

4. Minor: PastedImages is never emptied and nothing can fill it yet (upload_rt.rs:95-126). The doc says images are kept "until the upload that sends them has read them (or the session ends)", but nothing calls forget, and cancel_all on a session change leaves them in place. Pasted PNGs would stay in memory for the life of the process and could outlive the account switch. The UI also has no path to Desktop::pasted_images() (fluxer_ui::run only gets ClipboardImages). #365 owns the producer. When it lands, please also clear the images on a session change and after a job ends.

5. Minor: perform_chat ends with _ => Err(not_a_chat_request()) (runtime.rs). When Text chat 38 adds the Phase 5 ApiRequest variants, the compiler will not point Task 42 at them; they will fail at runtime with 501 instead. UploadCommand is matched exhaustively, as the Phase 5 note asks. Consider listing the non-chat variants explicitly.

6. Minor (process): the task touched two crates and the commit trailer is wrong. The task touches crates/fluxer-ui (run signature, Copied subscription), which the plan's Files list does not name. The deviation is declared and justified, and the new run parameters match what the Interfaces block requires ("injects Dialogs and ClipboardImages into fluxer_ui::run"). The commit trailer is Claude Opus 5.5, but the repo's CLAUDE.md requires Claude Fable 5.2; it cannot be amended without a force-push.

Checked and fine

  • Tests: 7 of the plan's 8 exist and assert what the plan says. Multipart progress total equals both files and the bytes read back match. Presigned: a 21 MiB + 5 file goes up as 3 parts plus a singlepart file and reassembles in order. Cancel drops the body and emits no Done/Failed. The reaction echo is counted once. Search returns Indexing, then Results. Record has no upload URL or path. Clipboard ID pair is {channel}-{message}.
  • Constants match the plan and spec: PROGRESS_INTERVAL 100 ms, PARALLEL_PARTS 4, PART_ATTEMPTS 4, backoff 500 ms doubling, capped at 8000 ms.
  • Presigned part splitting in upload_rt::multi is correct. The plan's part count is checked against div_ceil(size, part_size), only the last part may be short, a file that is too long or too short is an error, at most 4 parts are in flight (JoinSet), and a failed part aborts the others when the set is dropped. Singlepart retries reopen the file and hand back the counted progress.
  • Uploads are cancelled on a session change: Uploads::cancel_all() runs when the token changes, alongside the epoch bump, and stale reports are dropped by epoch.
  • Copied subscription in fluxer-ui/src/app.rs: it has a fixed identity and is always in the batch. The receiver is taken once and the text is written with iced::clipboard::write, so fluxer-ui gains no I/O path.
  • Upload URLs: they stay SecretString, PUT errors use without_url(), presign/PUT/complete are not observed, --record strips signatures, and errors carry no file paths (unit test).
  • fluxer-core, fluxer-emoji and the fixtures are untouched. No new dependency beyond futures-util, which is already a workspace dependency.

CI

FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in the review worktree (b09adbe, Linux): green ("xtask ci: all steps passed", exit 0).

Verdict: changes requested. One blocking finding (#1, a signed attachment URL can reach the log files); everything else is minor or already tracked.

## Review: Text chat 21 (app-textchat-runtime), independent reviewer Reviewed `git diff 173ee747..origin/textchat-21-app-textchat-runtime` (b09adbe) cold. ### Findings **1. BLOCKING: signed attachment URLs reach the log files (`apps/fluxer/src/desktop_rt.rs:156-160` and `:202`).** `ClipboardWrite::Image` and `FileDialog::SaveAttachment` call `client.fetch_media(&url)` and on failure log `tracing::warn!(%error, …)`. `fetch_media` (`fluxer-api/src/soundboard.rs` `fetch_capped`) turns `send()`/`chunk()` failures into `ApiError::Transport(reqwest::Error)` *with* the URL. `ApiError`'s Display is `transport error: {0}`, and reqwest 0.12.28's `Display` appends ` for url ({url})` (`reqwest/src/error.rs:267-268`). A DNS, connect, TLS, timeout or mid-body failure while saving or copying an attachment therefore writes `…/attachments/…?ex=…&is=…&hm=…` at `warn` into `fluxer.<date>.log`. That breaks the Global Constraint "No … signed attachment URL … in logs" and Review Focus 5, which is this task's. (`runtime::core_error` already strips the URL with `without_url()`; `desktop_rt` skips that step.) Fix: log `error` after mapping `ApiError::Transport(e)` to `e.without_url()`, or log only a kind/status. Add a unit test: point `fetch_media` at an unroutable signed URL and assert that the logged/Display text holds no `hm=`. **2. Minor: the signed-URL check in `record_mode_never_contains_upload_or_signed_urls` tests nothing (`apps/fluxer/tests/textchat_runtime.rs:515-518`).** The devserver never signs attachment URLs (no `ex=`/`hm=` anywhere in `crates/fluxer-devserver/src`), so `!content.contains("hm=")` cannot fail. The unit test `record::signed_attachment_urls_lose_their_signature` does cover the redaction. Either make the devserver sign `/media/attachments/` URLs or note in the test that the check only guards against regressions. **3. Minor: plan items deferred, each with a follow-up.** `play_audio_attachment_reaches_mixer` is missing and `PlaybackSource::Attachment` is not executed: the variant is not on the base yet, although it is in Text chat 10's Produces list (#364). The `SaveAttachment` download is capped at `MAX_MEDIA_BYTES` = 32 MiB, while spec §8 says to raise it to the instance's attachment limit (#364). On that failure the user sees nothing, only a `warn`. `DeleteRecentMention` still returns 501 (#362) and `TypingCooldown` is not produced (#363). These are acceptable as deferrals. **4. Minor: `PastedImages` is never emptied and nothing can fill it yet (`upload_rt.rs:95-126`).** The doc says images are kept "until the upload that sends them has read them (or the session ends)", but nothing calls `forget`, and `cancel_all` on a session change leaves them in place. Pasted PNGs would stay in memory for the life of the process and could outlive the account switch. The UI also has no path to `Desktop::pasted_images()` (`fluxer_ui::run` only gets `ClipboardImages`). #365 owns the producer. When it lands, please also clear the images on a session change and after a job ends. **5. Minor: `perform_chat` ends with `_ => Err(not_a_chat_request())` (`runtime.rs`).** When Text chat 38 adds the Phase 5 `ApiRequest` variants, the compiler will not point Task 42 at them; they will fail at runtime with 501 instead. `UploadCommand` is matched exhaustively, as the Phase 5 note asks. Consider listing the non-chat variants explicitly. **6. Minor (process): the task touched two crates and the commit trailer is wrong.** The task touches `crates/fluxer-ui` (`run` signature, `Copied` subscription), which the plan's Files list does not name. The deviation is declared and justified, and the new `run` parameters match what the Interfaces block requires ("injects `Dialogs` and `ClipboardImages` into `fluxer_ui::run`"). The commit trailer is `Claude Opus 5.5`, but the repo's CLAUDE.md requires `Claude Fable 5.2`; it cannot be amended without a force-push. ### Checked and fine - Tests: 7 of the plan's 8 exist and assert what the plan says. Multipart progress total equals both files and the bytes read back match. Presigned: a 21 MiB + 5 file goes up as 3 parts plus a singlepart file and reassembles in order. Cancel drops the body and emits no Done/Failed. The reaction echo is counted once. Search returns `Indexing`, then `Results`. Record has no upload URL or path. Clipboard ID pair is `{channel}-{message}`. - Constants match the plan and spec: `PROGRESS_INTERVAL` 100 ms, `PARALLEL_PARTS` 4, `PART_ATTEMPTS` 4, backoff 500 ms doubling, capped at 8000 ms. - Presigned part splitting in `upload_rt::multi` is correct. The plan's part count is checked against `div_ceil(size, part_size)`, only the last part may be short, a file that is too long or too short is an error, at most 4 parts are in flight (`JoinSet`), and a failed part aborts the others when the set is dropped. Singlepart retries reopen the file and hand back the counted progress. - Uploads are cancelled on a session change: `Uploads::cancel_all()` runs when the token changes, alongside the epoch bump, and stale reports are dropped by epoch. - `Copied` subscription in `fluxer-ui/src/app.rs`: it has a fixed identity and is always in the batch. The receiver is taken once and the text is written with `iced::clipboard::write`, so `fluxer-ui` gains no I/O path. - Upload URLs: they stay `SecretString`, PUT errors use `without_url()`, presign/PUT/complete are not observed, `--record` strips signatures, and errors carry no file paths (unit test). - `fluxer-core`, `fluxer-emoji` and the fixtures are untouched. No new dependency beyond `futures-util`, which is already a workspace dependency. ### CI `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in the review worktree (b09adbe, Linux): **green** ("xtask ci: all steps passed", exit 0). **Verdict: changes requested. One blocking finding (#1, a signed attachment URL can reach the log files); everything else is minor or already tracked.**
A failed download for copying an image or saving an attachment logged the
fetch_media error, whose transport variant printed the signed attachment
URL (ex/is/hm). The error is now logged without its URL (loggable), with
a test against a refused connection.

perform_chat lists the requests it does not handle instead of a wildcard,
so a new ApiRequest fails to compile until it is placed. The record-mode
test drops a check the devserver could never fail (record's unit test
covers the redaction), and the PastedImages doc says what is true today
(#365 forgets the images).

Refs #271

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Author
Owner

Review round 1, fixed in bb1409c:

  • Blocking, desktop_rt.rs (signed URL in the log): fixed. Copying an image and SaveAttachment now log loggable(error), which strips the URL from ApiError::Transport with reqwest::Error::without_url(). New test a_failed_media_download_logs_no_signed_url downloads ...?ex=..&is=..&hm=signature from a refused port and asserts the logged text has no hm=, signature or path. Without the fix it fails and prints error sending request for url (http://127.0.0.1:1/attachments/...&hm=signature).
  • Minor, tests/textchat_runtime.rs (hm= check cannot fail): removed that assert. A comment now says the redaction is checked by record's unit test, because the devserver does not sign URLs.
  • Minor, runtime.rs (deferred items): no change. They are already tracked in #362, #363 and #364.
  • Minor, upload_rt.rs (PastedImages::forget never called): the doc now says what happens today: images are kept while the runtime runs. Forgetting them after the upload and on a session change stays with #365.
  • Minor, runtime.rs (perform_chat wildcard): replaced with an explicit list of the requests perform handles. A new ApiRequest variant (Phase 5, Task 42) now fails to compile until someone places it.
  • Minor, process (fluxer-ui touched; trailer): the fluxer-ui change is declared in the PR and is unchanged. The new commit uses the Claude Fable 5.2 trailer. Fixing the trailer on b09adbe would need a history rewrite, and force-pushing is not allowed, so that commit keeps it.

Local FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green.

Review round 1, fixed in bb1409c: - **Blocking, `desktop_rt.rs` (signed URL in the log):** fixed. Copying an image and SaveAttachment now log `loggable(error)`, which strips the URL from `ApiError::Transport` with `reqwest::Error::without_url()`. New test `a_failed_media_download_logs_no_signed_url` downloads `...?ex=..&is=..&hm=signature` from a refused port and asserts the logged text has no `hm=`, signature or path. Without the fix it fails and prints `error sending request for url (http://127.0.0.1:1/attachments/...&hm=signature)`. - **Minor, `tests/textchat_runtime.rs` (`hm=` check cannot fail):** removed that assert. A comment now says the redaction is checked by `record`'s unit test, because the devserver does not sign URLs. - **Minor, `runtime.rs` (deferred items):** no change. They are already tracked in #362, #363 and #364. - **Minor, `upload_rt.rs` (`PastedImages::forget` never called):** the doc now says what happens today: images are kept while the runtime runs. Forgetting them after the upload and on a session change stays with #365. - **Minor, `runtime.rs` (`perform_chat` wildcard):** replaced with an explicit list of the requests `perform` handles. A new `ApiRequest` variant (Phase 5, Task 42) now fails to compile until someone places it. - **Minor, process (fluxer-ui touched; trailer):** the fluxer-ui change is declared in the PR and is unchanged. The new commit uses the `Claude Fable 5.2` trailer. Fixing the trailer on b09adbe would need a history rewrite, and force-pushing is not allowed, so that commit keeps it. Local `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green.
Author
Owner

Independent review: Text chat 21 (round 2, at bb1409c)

I reviewed git diff 173ee74..origin/textchat-21-app-textchat-runtime cold, without relying on the implementer's notes.

Checks

  • Plan tests: 7 of the 8 named tests are in apps/fluxer/tests/textchat_runtime.rs and assert what the plan asks. They cover multipart progress total and the bytes downloaded back, presigned 3 parts plus a singlepart file reassembled in order, cancel dropping the body with no Done or Failed, the reaction echo counted once, indexing then results, --record without upload URLs or paths, and a fake text clipboard. play_audio_attachment_reaches_mixer is missing; see finding 1.
  • Interfaces: every ApiRequest is executed by perform_chat, and the explicit list of other variants makes a new variant a compile error. The constants match the plan: 100 ms throttle, PARALLEL_PARTS = 4, PART_ATTEMPTS = 4, 500 to 8000 ms backoff. Cancel aborts the job, a session change aborts every job, and uploads report only within their epoch. Text goes to iced's clipboard and images to ArboardClipboard. OpenFileDialog goes to RfdDialogs and comes back as CoreEvent::Files with unique ids. Save attachment downloads and writes the file. Dialogs and ClipboardImages are injected into fluxer_ui::run.
  • Invariants: fluxer-core is untouched. fluxer-ui gains no I/O: the copy receiver is a channel subscription, the text is written with iced::clipboard::write, and ClipboardImages is only stored for #365. The upload PUTs, presign and complete requests are unobserved and their errors carry no URL (without_url). The fetch_media errors in desktop_rt now go through loggable(), which fixes the blocking finding of round 1, and a_failed_media_download_logs_no_signed_url covers it. Reader errors carry no path. --record strips ex/is/hm/uc from /attachments/ URLs in both REST and gateway bodies. No new fixtures were added.
  • Review Focus 5 (no upload URL, signed URL or path in logs or --record): satisfied.
  • Local FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in a fresh review worktree: all steps passed (fmt, clippy, deny, core-isolation, parity, test, vendored-tests, screenshot-tests, livekit-interop).

Findings

  1. minor: The plan test play_audio_attachment_reaches_mixer and the PlaybackSource::Attachment fetch-and-play wiring are not delivered. audio_rt.rs still maps attachments to a hashed clip tag. The deferral is justified because chat/media.rs on the base is a 44-line stub until Text chat 16. It is tracked in #364 (follow-up), which Text chat 16 and 22 must pick up.
  2. minor: Save attachment and copy image use fetch_media, which is capped at 32 MiB. Spec §8 asks for the instance's attachment limit, so saving a larger attachment fails with only a warn log line. Tracked in #364.
  3. minor: search_indexing_then_results calls perform_chat directly instead of going through the store, because the store's search is a stub until Text chat 17. This is documented as a deviation in the PR body.
  4. minor: The upload retry on RateLimited sleeps the fixed backoff and ignores retry_after.
  5. minor: PastedImages are never forgotten, so pasted images stay in memory for the life of the runtime. Tracked in #365.
  6. minor (process): Commit b09adbe ends with Co-Authored-By: Claude Opus 5.5, but CLAUDE.md requires Claude Fable 5.2. Force-push is denied, so this cannot be fixed now; bb1409c is correct.
  7. minor: The branch is 3 commits behind origin/textchat (the CI release workflow and the voice_rt.rs PipeWire init). git merge-tree shows a clean merge.
  8. note: crates/fluxer-ui is touched outside the task's file list (run signature, UiMessage::Copy). The Interfaces block requires this, and the PR documents it.

Verdict: approved. There are no blocking findings, and local ci is green.

## Independent review: Text chat 21 (round 2, at bb1409c) I reviewed `git diff 173ee74..origin/textchat-21-app-textchat-runtime` cold, without relying on the implementer's notes. **Checks** - Plan tests: 7 of the 8 named tests are in `apps/fluxer/tests/textchat_runtime.rs` and assert what the plan asks. They cover multipart progress total and the bytes downloaded back, presigned 3 parts plus a singlepart file reassembled in order, cancel dropping the body with no Done or Failed, the reaction echo counted once, indexing then results, `--record` without upload URLs or paths, and a fake text clipboard. `play_audio_attachment_reaches_mixer` is missing; see finding 1. - Interfaces: every `ApiRequest` is executed by `perform_chat`, and the explicit list of other variants makes a new variant a compile error. The constants match the plan: 100 ms throttle, `PARALLEL_PARTS = 4`, `PART_ATTEMPTS = 4`, 500 to 8000 ms backoff. Cancel aborts the job, a session change aborts every job, and uploads report only within their epoch. Text goes to iced's clipboard and images to `ArboardClipboard`. `OpenFileDialog` goes to `RfdDialogs` and comes back as `CoreEvent::Files` with unique ids. Save attachment downloads and writes the file. `Dialogs` and `ClipboardImages` are injected into `fluxer_ui::run`. - Invariants: `fluxer-core` is untouched. `fluxer-ui` gains no I/O: the copy receiver is a channel subscription, the text is written with `iced::clipboard::write`, and `ClipboardImages` is only stored for #365. The upload `PUT`s, presign and complete requests are unobserved and their errors carry no URL (`without_url`). The `fetch_media` errors in `desktop_rt` now go through `loggable()`, which fixes the blocking finding of round 1, and `a_failed_media_download_logs_no_signed_url` covers it. Reader errors carry no path. `--record` strips `ex`/`is`/`hm`/`uc` from `/attachments/` URLs in both REST and gateway bodies. No new fixtures were added. - Review Focus 5 (no upload URL, signed URL or path in logs or `--record`): satisfied. - Local `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in a fresh review worktree: **all steps passed** (fmt, clippy, deny, core-isolation, parity, test, vendored-tests, screenshot-tests, livekit-interop). **Findings** 1. *minor*: The plan test `play_audio_attachment_reaches_mixer` and the `PlaybackSource::Attachment` fetch-and-play wiring are not delivered. `audio_rt.rs` still maps attachments to a hashed clip tag. The deferral is justified because `chat/media.rs` on the base is a 44-line stub until Text chat 16. It is tracked in #364 (follow-up), which Text chat 16 and 22 must pick up. 2. *minor*: Save attachment and copy image use `fetch_media`, which is capped at 32 MiB. Spec §8 asks for the instance's attachment limit, so saving a larger attachment fails with only a warn log line. Tracked in #364. 3. *minor*: `search_indexing_then_results` calls `perform_chat` directly instead of going through the store, because the store's search is a stub until Text chat 17. This is documented as a deviation in the PR body. 4. *minor*: The upload retry on `RateLimited` sleeps the fixed backoff and ignores `retry_after`. 5. *minor*: `PastedImages` are never forgotten, so pasted images stay in memory for the life of the runtime. Tracked in #365. 6. *minor (process)*: Commit b09adbe ends with `Co-Authored-By: Claude Opus 5.5`, but `CLAUDE.md` requires `Claude Fable 5.2`. Force-push is denied, so this cannot be fixed now; bb1409c is correct. 7. *minor*: The branch is 3 commits behind `origin/textchat` (the CI release workflow and the `voice_rt.rs` PipeWire init). `git merge-tree` shows a clean merge. 8. *note*: `crates/fluxer-ui` is touched outside the task's file list (`run` signature, `UiMessage::Copy`). The Interfaces block requires this, and the PR documents it. **Verdict: approved.** There are no blocking findings, and local ci is green.
charles manually merged commit a8c9c3f4fd into textchat 2026-11-13 02:14:17 +00:00
Sign in to join this conversation.
No description provided.