Skip to content

fix(chat): preserve drafts after failed composer submissions - #180

Open
rudycelekli wants to merge 2 commits into
Merit-Systems:mainfrom
rudycelekli:fix/preserve-failed-composer-drafts
Open

rudycelekli wants to merge 2 commits into
Merit-Systems:mainfrom
rudycelekli:fix/preserve-failed-composer-drafts

Conversation

@rudycelekli

Copy link
Copy Markdown

Problem

The shipped chat composer resets its uncontrolled form before sending a message. When the actual Eve client rejects the send, the submitted text has already disappeared, preventing a straightforward retry.

Change

Restore the captured text on synchronous or asynchronous submission failure when the current textarea is still empty. Keep immediate reset on submission, successful-send clearing and a newer nonempty draft. Emit an input event so the compact composer measures restored text.

Evidence

  • Actual React ChatInput, unchanged useSessionAgent, installed Eve Client and original UI primitives with native Chromium FormData/textarea: a local HTTP 503 reports the actual client error and loses the draft before, preserves it after. Only tRPC chat-metadata saving is stubbed; no model or deployed agent is claimed.
  • Native successful-send control uses an accepted Eve25 NDJSON boundary and still clears the sent draft. A component-only held HTTP failure retains a later nonempty draft. All three controls pass after; the failed-send case fails before.
  • The same final focused callback fixture on unchanged production source has 2 failures / 5 passes; patched source has 7 passes. Existing three SSR controls remain. These callback tests use a small explicit DOM boundary; the independent browser proof establishes native DOM behavior. Strict focused lint passed.
  • Unchanged declared Checks, final source head d8e12f11f134f5f037da6a265ce13729a7952631: frozen installation, full pnpm check (6 tasks; 95 files / 880 tests), and pnpm test:runtime (2 evaluations / 13 gates) passed, including post-job cleanup. GitHub checked out merge commit ba847b3a744afbb811ed39084fb83f8c5d27fed0, whose tree exactly matches the source head.
  • Separate owned-fork production build checked out that exact final source head, verified its identity, installed with the frozen lockfile and passed actual pnpm build (1 task). This supplemental verification workflow is outside the proposed source patch and uses fresh public installation fixtures.

The original hosted Checks and supplemental build on 1032f6a failed on a regression-test callback type (TS2345); runtime was skipped in those failed Checks. A normal signed followup explicitly declares the callback argument. Production source is byte-identical, and the final same-byte fixture retains the before/after result above. Local heavy builds were held because the shared host repeatedly ran out of disk space; the required commands completed successfully in the hosted verification above.

Recovery applies to the current empty uncontrolled textarea. It preserves a later nonempty draft; this does not claim recovery for provider-controlled input. No agent, database, dependency or upstream workflow changes. Both commits are signed and carry DCO signoffs.

AI assistance was used for investigation, implementation, tests and source review under the submitting account.

Upstream workflow authorization is separate; no pending upstream check is claimed green.

Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
Signed-off-by: Rudy Celekli <rudy@gradiahq.com>

This branch has not been deployed

No deployments
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.

1 participant