Skip to content

refactor(app): keep one definition of errorMessage and eventRunId - #2385

Merged
DeliciousBuding merged 1 commit into
masterfrom
refactor/shared-error-helpers
Oct 19, 2026
Merged

DeliciousBuding merged 1 commit into
masterfrom
refactor/shared-error-helpers

Conversation

@DeliciousBuding

Copy link
Copy Markdown
Collaborator

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 in web/src/App.tsx, and a third in desktop/src/platform/useDesktopWorkbenchModel.ts. The App.tsx copy dropped the typeof 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/edgeEventEvidence version in desktop/src/platform/useDesktopEdgeEvents.ts.

What changed

  • shared/src/errors.ts now owns errorMessage next to AppError / parseError, with the union semantics (Error.message, non-blank thrown string, fallback) and unit tests for all three branches.
  • webWorkbenchError.ts is deleted; its five importers (and App.tsx) import from @shared/errors. The two web test cases that only exercised the helper moved into shared/src/errors.test.ts, so coverage is unchanged, not dropped.
  • Desktop and web both import the shared definition; the desktop eventRunId copy is replaced by the shared export.

Behaviour note: web/App.tsx now 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 webWorkbenchError over the repo: no hits.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: TokenDanceLab/AgentHub/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7128d564-7c73-4b83-9ffe-d1d2ab1559fb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

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

Co-authored-by: Codex <codex@delicious233.com>
@DeliciousBuding
DeliciousBuding force-pushed the refactor/shared-error-helpers branch from ab6e0da to f086958 Compare October 19, 2026 13:51
@DeliciousBuding
DeliciousBuding merged commit 15a4eb6 into master Oct 19, 2026
34 checks passed
@DeliciousBuding
DeliciousBuding deleted the refactor/shared-error-helpers branch October 19, 2026 13:56
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