Skip to content

fix(desktop): avoid stack overflow on embedded image replay - #51093

Merged
OutThisLife merged 1 commit into
mainfrom
bb/desktop-string-stack-overflow
Jun 22, 2026
Merged

OutThisLife merged 1 commit into
mainfrom
bb/desktop-string-stack-overflow

Conversation

@OutThisLife

Copy link
Copy Markdown

Summary

  • Replace the desktop embedded-image regex replacement with a small scanner so multi-megabyte data:image/...;base64,... payloads do not throw RangeError: Maximum call stack size exceeded during session replay.
  • Preserve existing bare data URL and JSON image_url envelope extraction behavior.
  • Add a regression for an 8 MB embedded image URL, matching the crash class seen when opening the affected session.

Test plan

  • npm run test:ui -- src/lib/embedded-images.test.ts
  • npx eslint src/lib/embedded-images.ts src/lib/embedded-images.test.ts
  • npm run build

Replace the giant embedded-image regex with a bounded scanner so opening sessions with multi-megabyte data URLs does not crash the renderer.
@github-actions

Copy link
Copy Markdown

🔎 Lint report: bb/desktop-string-stack-overflow vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 11461 on HEAD, 11461 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 6038 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@OutThisLife
OutThisLife enabled auto-merge June 22, 2026 23:21
@OutThisLife
OutThisLife merged commit b90f1e4 into main Jun 22, 2026
34 checks passed
@OutThisLife
OutThisLife deleted the bb/desktop-string-stack-overflow branch June 22, 2026 23:26
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
…ring-stack-overflow

fix(desktop): avoid stack overflow on embedded image replay
habarmc1223-sudo pushed a commit to habarmc1223-sudo/hermes-agent-fluxmem that referenced this pull request Jul 8, 2026
…ring-stack-overflow

fix(desktop): avoid stack overflow on embedded image replay
santhreal pushed a commit to santhreal/hermes-agent that referenced this pull request Jul 13, 2026
…ring-stack-overflow

fix(desktop): avoid stack overflow on embedded image replay
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
…ring-stack-overflow

fix(desktop): avoid stack overflow on embedded image replay
leewenjie pushed a commit to leewenjie/hermes-agent that referenced this pull request Aug 7, 2026
…ring-stack-overflow

fix(desktop): avoid stack overflow on embedded image replay
melon-xf added a commit to melon-xf/hermes-agent that referenced this pull request Sep 3, 2026
…ring-stack-overflow

fix(desktop): avoid stack overflow on embedded image replay
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