Skip to content

fix(desktop): bound browser requests and document backend trust - #93

Open
trmosala wants to merge 1 commit into
v2-upgradefrom
browser-request-limits
Open

trmosala wants to merge 1 commit into
v2-upgradefrom
browser-request-limits

Conversation

@trmosala

Copy link
Copy Markdown
Owner

Summary

Browser request saturation previously dropped ordinary requests without a reply, while revocations could bypass the active-work limit. This change returns explicit overload failures, caps sender waiters and desktop active work at 256 ordinary requests plus 16 reserved revocation slots, and preserves cancellation and native-settlement accounting.

Request envelopes now have a 128 KiB UTF-8 JSON budget. Sender admission checks before transmission; desktop validates the full inner envelope (including unused fields) before parsing and closes the channel on invalid/oversized input. Duplicate IDs preserve the original response waiter. The budget accommodates existing escaped text and site-tool inputs. Outer SSE/RPC allocations and response budgets are unchanged; this is not a process-wide memory guarantee.

Documents the #83 trust decision: the authenticated shared OpenCode backend is trusted to identify sessions, while desktop retains browser grant enforcement. Isolation after backend compromise is outside this guarantee. No per-task credentials or worker isolation are added. Verified that normal CookieMonster startup uses the server's localhost default and requires authentication; no binding changes were needed.

Closes #83. Base: v2-upgrade.

Validation

  • 186 desktop tests passed: bridge, router, delegation, session resolver (including ownership, revocation, failed lookup, cancellation and delivery checks).
  • 10 wire/port tests passed, including size limits, UTF-8, overload recovery and reserved control capacity. Exact-limit wire assertions also passed after their addition.
  • Desktop and cm-browser package typechecks passed.
  • Client generation completed with no generated changes.
  • Required pre-push bun run check passed.
  • Strict lint:changed origin/v2-upgrade remains blocked by 10 pre-existing bridge warnings (unknown IPC boundaries and conditional spreads). Verified those same warnings on the base branch; no suppressions or unrelated cleanup added. A separate lint cleanup would be needed for that stricter check.

@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant