Skip to content

fix(ocap-kernel): fix trailing comma in OCAP URLs when no relays are known#850

Merged
sirtimid merged 2 commits intomainfrom
sirtimid/fix-ocap-url-trailing-comma
Feb 24, 2026
Merged

fix(ocap-kernel): fix trailing comma in OCAP URLs when no relays are known#850
sirtimid merged 2 commits intomainfrom
sirtimid/fix-ocap-url-trailing-comma

Conversation

@sirtimid
Copy link
Contributor

@sirtimid sirtimid commented Feb 24, 2026

Summary

  • issueOcapURL appended a trailing comma when knownRelays was empty (e.g. ocap:...@peerId,), which could cause issues with URL parsing downstream
  • Hardened parseOcapURL to filter empty hint strings from the split result for backwards compatibility with any existing URLs that have trailing commas

Test plan

  • Existing remote-comms.test.ts tests pass
  • Build passes

🤖 Generated with Claude Code


Note

Low Risk
Small, localized string/formatting changes to OCAP URL handling plus a typo fix; low likelihood of side effects beyond relay-hint parsing.

Overview
Fixes OCAP URL generation to omit the trailing comma when knownRelays is empty, preventing URLs like ocap:...@peerId,.

Hardens parseOcapURL to drop empty location-hint entries (maintaining compatibility with any previously issued trailing-comma URLs), and corrects a minor typo in a VatSupervisor init error string.

Written by Cursor Bugbot for commit 5dee5a7. This will update automatically on new commits. Configure here.

…known

issueOcapURL appended a trailing comma when knownRelays was empty
(e.g. `ocap:...@peerid,`). Fix by only appending the relay suffix when
relays exist. Also harden parseOcapURL to filter empty hint strings
from the split result.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sirtimid sirtimid requested a review from a team as a code owner February 24, 2026 16:49
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 75.99%
⬆️ +0.09%
6552 / 8622
🔵 Statements 75.88%
⬆️ +0.09%
6657 / 8773
🔵 Functions 73.79%
🟰 ±0%
1639 / 2221
🔵 Branches 75.37%
⬆️ +0.20%
2418 / 3208
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/ocap-kernel/src/remotes/kernel/remote-comms.ts 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
packages/ocap-kernel/src/vats/VatSupervisor.ts 72.72%
🟰 ±0%
42.42%
🟰 ±0%
58.33%
🟰 ±0%
72.72%
🟰 ±0%
125, 136, 144, 182, 220-224, 235, 244-245, 266-268, 271, 275-277, 309-311, 328, 345-353
Generated in workflow #3795 for commit 5dee5a7 by the Vitest Coverage Report Action

@sirtimid sirtimid enabled auto-merge February 24, 2026 17:05
Copy link
Contributor

@FUDCo FUDCo left a comment

Choose a reason for hiding this comment

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

Right-ee-o!

@sirtimid sirtimid added this pull request to the merge queue Feb 24, 2026
Merged via the queue into main with commit 637be39 Feb 24, 2026
29 checks passed
@sirtimid sirtimid deleted the sirtimid/fix-ocap-url-trailing-comma branch February 24, 2026 18:03
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.

2 participants