Skip to content

fix(tlon): links and images break on parenthesized URLs - #167191

Merged
obviyus merged 2 commits into
openclaw:mainfrom
ly85206559:codex/fix-tlon-balanced-destinations-20261008
Oct 9, 2026
Merged

obviyus merged 2 commits into
openclaw:mainfrom
ly85206559:codex/fix-tlon-balanced-destinations-20261008

Conversation

@ly85206559

@ly85206559 ly85206559 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: Tlon messages contain broken links or image URLs when a Markdown destination includes balanced parentheses, such as Wikipedia's Function_(mathematics) URL.

User Impact

User impact: labeled links and inline images keep their complete destinations in direct messages, group posts, and thread replies. No configuration, dependency, or public API changes are required.

Why This Change Was Made

The existing story parser stops at the first closing parenthesis, even when it belongs inside the destination. Match the balanced destination in that same owner for both links and images; keep bare-URL punctuation handling and native message encoding unchanged. This follows the bare-URL repair in #164828 without changing the Markdown surface more broadly.

Evidence

  • Exact product head: 9a06576ccd33dacf8fb7f00d86f15879c2dd696f; two commits, two files. The temporary proof workflow and harness are not part of this PR.
  • Before-fix run: the complete story test file collected 65 tests, with exactly the four new balanced/nested link/image assertions failing and 61 existing assertions passing. Identical test bytes are used for the fix.
  • Built CLI proof uses the supported pnpm openclaw message send command and registered, compiled Tlon plugin, with 12 independent fixtures across DM/group/thread: 12 defect observations plus 24 controls. The baseline sends a truncated href/image.src to the synthetic Urbit HTTP boundary; every command exits successfully and each send has exactly one login and one poke. V8 witnesses show both compiled markdownToStory and parseInlineMarkdown executing. All 36 isolated states and loopback servers are cleaned up.
  • After-fix run, testing the exact product head above: 65/65 story tests, 14/14 registered-sender/loopback/Urbit sender tests, actual node scripts/check-changed.mjs -- extensions/tlon/src/urbit/story.ts extensions/tlon/src/urbit/story.test.ts checks (including formatting, extension/test types, lint, dead exports, boundaries, and cycles), and pnpm build passed. All 36 built CLI cases now emit the complete expected native payloads; command exits are 0, no timeouts, one login/poke per case, two positive compiled-parser witnesses per case, and all state/server cleanup records are true. The same 24 controls remain correct.
  • The run artifacts include owner-tests.json, sibling-tests.json, changed-checks.log, build.log, and cli/summary.json. Frozen proof tools and workflow stay on a separate fork-only branch. Test/harness SHA-256 values match the before-fix artifacts; the summary binds source head, source hashes, compiled-parser hashes, payloads, exits, and cleanup.
  • Fresh complete-branch P0–P3 autoreview on the exact product head: scoped-clean, findings=[], no priority-filtered findings, confidence 0.91. git diff --check passes.
  • Upstream CI completed successfully on this exact head. ClawSweeper's exact-head review reports no findings or contributor-facing pre-merge actions and accepts the boundary proof as sufficient. Ordinary maintainer review is still required.

Proof boundary: genuine built CLI → synthetic loopback Urbit login/poke transport. No real service credentials are used; live Urbit rendering is not claimed. Controls include simple/percent-encoded destinations, inline code, bare URL parentheses and punctuation, and empty image alt text.

Build limitation: both before/after builds exit 0 but report an existing UI startup-size overage (373,683 B before, 373,670 B after, versus the 373,454 B enforcement figure printed by the report). No UI code, budget, or baseline was changed by this PR.

Outstanding external check: OpenGrep run 37768998777 failed before scanning, while downloading the pinned v1.30.0 binary: all five built-in attempts returned HTTP 500, ending with curl exit 22 and no SARIF output. This is not a reported source-code finding or a passed scan. The contributor has no upstream Actions write permission; a maintainer rerun is needed when that download is available. No scanner, workflow, or product-code bypass was added.

Maintainer verification

Independently exercised the real Tlon plugin outbound send path against a synthetic Urbit HTTP ship on current main c9a0c00b8691bda5bd7a38ee494b5edd8ecb9254 and candidate 9a06576ccd33dacf8fb7f00d86f15879c2dd696f in isolated Node 24 containers. Captured 21 poke payloads per ref across direct messages, group posts, and thread replies. All nine parenthesized-link/nested-link/image observations truncate on main and retain their complete destinations on the candidate. Twelve ordinary-link, ordinary-image, Markdown-parenthesis, and bare-URL controls are unchanged.

A real gpt-5-mini Responses call (reasoning low, output budget 4096) generated the Wikipedia Markdown link; all three candidate routes kept its complete href at the HTTP boundary. No live Urbit client rendering is claimed. Focused story tests passed 65/65 (Vitest 1.68 s; wrapper 2.46 s); scoped real tsgo passed.

No overlap with Pash/Sarah changes. No additional source changes were needed; contributor commits and exact-head review remain intact. No CI rerun was requested. The external OpenGrep download failure noted above remains unresolved; it occurred before source scanning.

Merge danger: two-way door for future sends; reverting restores the previous parser. Already delivered messages are not rewritten. Blast radius is Tlon Markdown link/image destination parsing only.

@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added channel: tlon Channel integration: tlon size: XS labels Oct 8, 2026
@ly85206559
ly85206559 marked this pull request as ready for review October 8, 2026 11:16
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 8, 2026
@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 8, 2026, 7:34 AM ET / 11:34 UTC (Revision 2).

ClawSweeper review

What this changes

The branch preserves balanced and nested parentheses in Tlon Markdown link and image destinations.

Example: Send See math! through Tlon

  • Before: The link ends at Function_(mathematics, leaving )! as trailing text.
  • After: The link retains Function_(mathematics), with only ! following it.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful, focused repair with shipped-CLI boundary proof and no open correctness finding.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The exact-product-head built CLI exercises the registered compiled Tlon converter and real HTTP sender against an isolated synthetic Urbit endpoint. Inspected assertions, successful before/after runs, and captured observations establish complete native destinations across DM/group/thread sends with unchanged controls; live client rendering is not claimed. Raw logs were proxy-blocked. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Tlon users receive broken labeled links and images when their URLs contain parentheses.
Reason: This restores the established rich-formatting contract with a focused parser repair and regression coverage.

Merge readiness

✅ Ready for maintainer review

This PR addresses a distinct formatting defect still present on current main. The focused repair has sufficient built-CLI boundary proof, and no actionable patch defect or contributor-facing blocker remains.

Priority: P2
Reviewed head: 9a06576ccd33dacf8fb7f00d86f15879c2dd696f

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Tlon plugin converts outgoing Markdown into native message content before sending it to an Urbit ship. Direct messages, group posts, thread replies, and media captions share this converter.

flowchart LR
A[Outgoing Markdown] --> B[Tlon message converter]
B --> C[Link or image destination]
C --> D[Track balanced parentheses]
D --> E[Native links and image blocks]
E --> F[Direct message or group sender]
F --> G[Urbit HTTP transport]
Loading

Technical review

Best possible solution:

Keep destination balancing in the existing Tlon converter while preserving native message shapes and bare-URL punctuation handling.

Do we have a high-confidence way to reproduce the issue?

Yes: current main's explicit-destination expressions truncate Function_(mathematics), and the supplied baseline CLI observations demonstrate the same failure at the HTTP boundary. No target code was executed during this review.

Is this the best way to solve the issue?

Yes: one shared destination scanner repairs links and images at their existing owner without adding configuration, dependencies, or a parallel formatting path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against bfc578fa5ef7.

Provenance checked

Testing

Proof path: shipped entry point. Added test files: 1.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • jayzhou2309: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • arthyn: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

PR surface

Source +22, Tests +16. Total +38 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 24 2 +22
Tests 1 19 3 +16
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 43 5 +38

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs broken outbound links and images for a bounded class of Tlon Markdown destinations.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-08T11:23:16.955Z sha 9a06576 :: needs maintainer review before merge. :: none

@obviyus
obviyus merged commit ac61a40 into openclaw:main Oct 9, 2026
196 of 198 checks passed
@obviyus

obviyus commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Landed in ac61a40. Thanks @ly85206559! Verified through the real Tlon send path against a mock ship in DMs, groups and threads: links and images with parenthesized URLs now keep the full href, and ordinary links are unchanged.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 9, 2026
)

Keep the full destination for Tlon Markdown links and images whose URL contains balanced parentheses (for example Wikipedia `Function_(mathematics)`), instead of cutting the href at the first `)`. Ordinary links, bare URLs and parenthesized text are unchanged.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: tlon Channel integration: tlon P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants