Skip to content

fix: normalize a typed browser address before opening a session - #102

Merged
jerelvelarde merged 2 commits into
CopilotKit:mainfrom
nvtoan0201-swe:fix/normalize-browser-address
Oct 6, 2026
Merged

jerelvelarde merged 2 commits into
CopilotKit:mainfrom
nvtoan0201-swe:fix/normalize-browser-address

Conversation

@nvtoan0201-swe

Copy link
Copy Markdown
Contributor

What changed

The Browser screen's "Open session" button posted the raw text field value, while the in-session address bar (details.tsx) and the computer sheet (computer.tsx) both normalize through browserAddress first. The server requires an absolute URL (z.url()), so typing copilotkit.ai in this one field failed validation even though the same text works in every other browser entry point.

The address is now normalized before the request. browserAddress already covers scheme-less hosts, credentials, and malformed input in apps/mobile/test/browser-address.test.ts.

Verification

  • pnpm test — 276 pass, 0 fail
  • pnpm lint
  • pnpm typecheck (root + mobile)

Integration limits

The component wiring itself is not covered by the repo's node:test helpers (they cover pure modules); the normalization helper it calls is covered.

AI assistance was used to prepare this change; I reviewed the code and ran the checks above.

BrowserScreen posted the raw text from Open session, while the in-session address bar and the computer sheet both run browserAddress first. The server requires an absolute URL, so typing copilotkit.ai failed validation even though the same text works everywhere else. Normalize the address before the request; browserAddress already covers schemes, credentials, and malformed input in its own tests.

@jerelvelarde jerelvelarde left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Value: typed browser addresses use the existing normalization/validation helper before opening a session. Two address-helper tests, changed-file Biome, mobile typecheck and diff checks pass after retaining both browserAddress and startOfZonedDay imports during main integration. Worker-side URL/security policy remains intact. Template: clear narrow fix and checks; please add UI evidence/platform limits if not supplied. No actionable security issue. Merge after required CI.

@jerelvelarde
jerelvelarde merged commit 0e00e66 into CopilotKit:main Oct 6, 2026
7 checks passed
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.

2 participants