Repository navigation
refactor(app): keep one definition of errorMessage and eventRunId - #2385
Merged
Merged
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-authored-by: Codex <codex@delicious233.com>
DeliciousBuding
force-pushed
the
refactor/shared-error-helpers
branch
from
October 19, 2026 13:51
ab6e0da to
f086958
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two helpers existed in several platform copies, and one of the copies had drifted:
errorMessage— three definitions:web/src/platform/webWorkbenchError.ts(exported, 5 importers), a second copy inline inweb/src/App.tsx, and a third indesktop/src/platform/useDesktopWorkbenchModel.ts. TheApp.tsxcopy dropped thetypeof error === 'string'branch, so a thrown string surfaced as the generic fallback while the same error on other paths showed its text.eventRunId— byte-identical copy of the exported@shared/transcript/edgeEventEvidenceversion indesktop/src/platform/useDesktopEdgeEvents.ts.What changed
shared/src/errors.tsnow ownserrorMessagenext toAppError/parseError, with the union semantics (Error.message, non-blank thrown string, fallback) and unit tests for all three branches.webWorkbenchError.tsis deleted; its five importers (andApp.tsx) import from@shared/errors. The two web test cases that only exercised the helper moved intoshared/src/errors.test.ts, so coverage is unchanged, not dropped.eventRunIdcopy is replaced by the shared export.Behaviour note:
web/App.tsxnow shows a thrown string's text instead of the fallback. That is the inconsistency being fixed, and the shared test pins it.Verified
pnpm --filter agenthub-web typecheck,pnpm --filter agenthub-desktop typecheck: pass.vitest run shared/src/errors.test.ts web/src/platform: 14 files / 161 tests pass;vitest run desktop/src/platform: 7 files / 64 tests pass.pnpm --filter agenthub-web lint(--max-warnings 0): pass. Desktop/shared lint: 0 errors (pre-existing warnings unchanged).rg webWorkbenchErrorover the repo: no hits.