Skip to content

fix(web): prevent empty task submissions and handle debug-mode errors#592

Open
grzdev wants to merge 1 commit intoaccomplish-ai:mainfrom
grzdev:fix/web-empty-prompt-and-debugmode-catch
Open

fix(web): prevent empty task submissions and handle debug-mode errors#592
grzdev wants to merge 1 commit intoaccomplish-ai:mainfrom
grzdev:fix/web-empty-prompt-and-debugmode-catch

Conversation

@grzdev
Copy link

@grzdev grzdev commented Feb 21, 2026

Description

Prevents submitting empty or whitespace-only prompts from "Home.tsx" and improves error handling for async flows.

  • Adds a guard clause to prevent empty task submissions.
  • Wraps "handleSubmit" in "try/catch`" to avoid unhandled promise rejections.
  • Adds ".catch()" to "accomplish.getDebugMode()" in "Execution.tsx" so failures aren’t silently swallowed.

This improves input validation and makes async errors more visible and predictable.

Type of Change

  • feat: New feature or functionality
  • fix: Bug fix
  • docs: Documentation only changes
  • chore: Maintenance, dependencies, or tooling
  • refactor: Code refactoring (no feature change)
  • test: Adding or updating tests
  • perf: Performance improvement
  • ci: CI/CD changes

Checklist

  • PR title follows conventional commit format (e.g., feat: add dark mode support)
  • Changes have been tested locally
  • Any new dependencies are justified

Related Issues

No related Issues

Summary by CodeRabbit

  • Bug Fixes
    • Added explicit error handling for debug mode retrieval to prevent unhandled promise rejections
    • Improved error handling in task submission flow to ensure errors are properly logged and managed gracefully

@coderabbitai
Copy link

coderabbitai bot commented Feb 21, 2026

Warning

Rate limit exceeded

@grzdev has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 10 minutes and 35 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

Error handling enhancements were added to two page components. Execution.tsx now includes a catch handler for the initial debug mode fetch to log errors. Home.tsx wraps the handleSubmit function logic in a try/catch block to gracefully handle errors during provider readiness checks and task submission.

Changes

Cohort / File(s) Summary
Error Handling in Page Components
apps/web/src/client/pages/Execution.tsx, apps/web/src/client/pages/Home.tsx
Added catch handlers to prevent unhandled promise rejections: debug mode fetch in Execution.tsx and submission flow in Home.tsx. Both changes log errors for debugging without altering existing control flow logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 whiskers twitch with pride
Promises caught before they fall,
Error handlers guard them all!
No more rejections in the night,
Clean logs and error-handling might,
Caught exceptions feel so right! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: preventing empty task submissions and handling debug-mode errors, which directly align with the modifications in Home.tsx and Execution.tsx.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@orcaman
Copy link
Contributor

orcaman commented Feb 21, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@grzdev grzdev force-pushed the fix/web-empty-prompt-and-debugmode-catch branch from bfe193e to 7a97a94 Compare February 21, 2026 22:15
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/web/src/client/pages/Home.tsx`:
- Around line 89-94: Remove the redundant inline comment that restates the code
in the try block; specifically, delete or replace the comment before the
isE2EMode check so it no longer paraphrases the logic around
accomplish.isE2EMode(), accomplish.getProviderSettings(), and
hasAnyReadyProvider(settings) — if a comment is needed, rewrite it to explain
why the E2E-mode and provider-readiness checks are necessary (context/intent),
not what the code does.

@grzdev grzdev force-pushed the fix/web-empty-prompt-and-debugmode-catch branch from 7a97a94 to 8d03256 Compare February 21, 2026 22:19
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