Skip to content

Keep blank pause errors inside conversation settings - #4

Merged
rustyorb merged 1 commit into
mainfrom
codex/stakia-settings-validation
Sep 17, 2026
Merged

rustyorb merged 1 commit into
mainfrom
codex/stakia-settings-validation

Conversation

@rustyorb

@rustyorb rustyorb commented Sep 17, 2026

Copy link
Copy Markdown
Owner

An empty speech-pause field could trigger FastAPI's JSON validation response, and the settings form's 422 handler could insert that JSON into the page.

Send empty pause input through the existing form validation, mark the field required in the browser, and replace the settings card only for HTML validation responses. Also update the Windows handoff to reflect the latest screenshot confirming ESP-IDF 5.5.4 is active and COM15 is listed as USB Serial Device.

Validation: 42 tests and 10 subtests passed locally with the pinned upstream fixture. Scoped code review closed with no outstanding findings. The repository tree matches the tested local checkout. Firmware compilation and physical device checks remain Windows bench steps.

This is a small follow-up to merged PRs #3 and #2. It does not block starting the firmware build from main.

Summary by Sourcery

Keep conversation settings validation contained to the settings card and refresh the Windows firmware setup status.

Bug Fixes:

  • Keep empty pause input within the settings form validation flow instead of returning an unhandled API validation payload.
  • Restrict 422 response swapping to HTML validation responses so JSON errors are not inserted into the settings page.

Enhancements:

  • Require a pause value in the browser settings form.
  • Update Windows firmware handoff guidance to confirm ESP-IDF 5.5.4 and COM15 as the detected USB serial device.

Documentation:

  • Refresh implementation and firmware build documentation with the latest ESP-IDF and serial-port verification details.

Copilot AI lite review requested due to automatic review settings September 17, 2026 12:23

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @rustyorb, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 7 days by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Sep 17, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The PR fixes blank pause-field handling by routing empty input through existing validation, adding browser-side required validation, and limiting HTMX 422 swaps to HTML responses so JSON errors do not appear in the settings card. It also updates host and firmware documentation to reflect that ESP-IDF 5.5.4 is active and COM15 is the observed USB serial device.

Sequence diagram for blank pause validation

sequenceDiagram
    actor User
    participant Browser
    participant Settings as HostSettings
    participant FastAPI

    User->>Browser: Submit settings form
    alt pause_seconds is blank
        Browser-->>User: required validation
    else form is submitted
        Browser->>FastAPI: host_settings_save(request, profile, pause_seconds, idle_mode)
        FastAPI->>Settings: validate pause_seconds
        alt HTML validation response
            Settings-->>Browser: 422 text/html
            Browser->>Browser: Replace host-settings card
        else JSON validation response
            Settings-->>Browser: 422 application/json
            Browser-->>User: Keep settings card unchanged
        end
    end
Loading

File-Level Changes

Change Details Files
Keep empty pause submissions in the normal form-validation flow and prevent non-HTML validation payloads from replacing the settings card.
  • Allow an empty pause field to reach application validation instead of FastAPI rejecting the request before the handler.
  • Require pause input in the browser.
  • Restrict HTMX 422 card replacement to responses with an HTML content type.
bridge/dashboard.py
bridge/templates/host_settings.html
Synchronize Windows setup documentation with the confirmed ESP-IDF and serial-port state.
  • Record ESP-IDF 5.5.4 as active rather than requiring installation alongside 6.1.
  • Retain COM15 identification and unplug/replug verification instructions.
docs/implementation-status.md
firmware/STAKIA-BUILD.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes correctly contain HTML validation errors without exposing JSON responses in the settings card.

Pull request overview

Keeps blank pause validation within the settings card and updates Windows firmware handoff documentation.

Changes:

  • Accept empty pause form values for application-level validation.
  • Restrict HTMX 422 swaps to HTML responses and require the browser field.
  • Refresh ESP-IDF and COM15 documentation.
File summaries
File Description
bridge/dashboard.py Routes blank pause values through form validation.
bridge/templates/host_settings.html Adds required validation and safe HTML-only swapping.
firmware/STAKIA-BUILD.md Updates Windows setup status.
docs/implementation-status.md Updates firmware handoff details.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@rustyorb
rustyorb merged commit ed917fc into main Sep 17, 2026
3 checks passed
@rustyorb
rustyorb deleted the codex/stakia-settings-validation branch September 17, 2026 14:31
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