Skip to content

fix(tlon): require request IDs for approval replies - #186243

Merged
mmaps merged 6 commits into
openclaw:mainfrom
mmaps:fix/tlon-explicit-approval-ids
Oct 28, 2026
Merged

mmaps merged 6 commits into
openclaw:mainfrom
mmaps:fix/tlon-explicit-approval-ids

Conversation

@mmaps

@mmaps mmaps commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Tlon owner approval replies could target a different pending request when another request arrived before the reply was handled. DM, restricted-channel mention, and group-invite approval requests all use this decision path.

User Impact

Bare approval decisions continue to work when exactly one request is pending. When multiple requests are pending, a reply without an ID lists them without changing DM access, channel authorization, group membership, or replaying a queued message.

Why This Change Was Made

The approval runtime uses the sole pending request for an unambiguous bare decision. When more than one request is pending, stable request IDs let the owner choose explicitly instead of falling back to the newest queue entry. Owner prompts and documentation explain both forms.

Evidence

  • Compatibility regression: a bare decision still acts when exactly one request is pending.
  • DM regression: with multiple requests pending, a bare decision leaves the allowlist and queue unchanged; an explicit ID affects only the selected requester.
  • Channel regression: fails on the base because a bare decision chooses the newest request, writes channelRules, and replays its queued mention; passes on this branch with zero ambiguous bare-decision effects and a selected-only explicit grant.
  • Group regression: fails on the base because a bare decision chooses the newest request and sends group-join; passes on this branch with zero ambiguous bare-decision joins and a selected-only explicit join.
  • Five touched Tlon monitor suites: 69 tests passed.
  • Extension production and test typechecks, touched-file formatting/oxlint, test-line ratchet, and git diff --check: passed.
  • Exact-head independent review gates: passed with no actionable source finding.

Validation gap: no live Tlon service was used. The isolated proof exercises the production monitor and approval runtime through a real local Urbit HTTP/SSE transport fixture.

Behavior Proof

Mandatory behavior proof for current head 113b48089253396599a9a7ed4e0ead5da856d4b0

Behavior proved: Through the shipped Tlon monitor and a real local Urbit HTTP/SSE transport, a bare owner decision affects exactly one sole pending request, ambiguous bare decisions and unauthorized senders cause zero protected effects, and ID-qualified owner decisions affect only the selected request.
Environment: local_openclaw - Local PR checkout with outbound networking disabled and synthetic configuration.
Local-only execution: actual OpenClaw path; network=outbound_disabled; third_party_contacts=0; external services are replaced by local deterministic boundaries
Privacy: synthetic_inputs=true; actual_user_config_loaded=false; scan=pass; report=redaction-report.json
Before merge obligations: covered=2; artifact=clawsweeper-obligations.json; artifact_sha256=aff21fb82d428f3a0623f235176548d7189a91826c3394558fc565f0f61cca86
Entry point: bash .local/run-tlon-approval-proof.sh via extensions/tlon/src/monitor/index.ts; faithful because monitorTlonProvider handled synthetic chat, channel, foreign-invite, and settings-update events through the real Urbit login and SSE client; its settings, channel-rule, group-join, and chat pokes were observed at a local HTTP boundary.
Protected boundary: authorization Tlon approval final-effect boundary; sink/source: Urbit settings allowlists, channel rules, group joins, chat blocks, and replay dispatch; denied effect: zero DM allowlist, channel-rule, group-join, block, or replay effects
Command/artifact:

  • bash .local/run-tlon-approval-proof.sh -> exit_code=0; artifact: proof-output.json; artifact_sha256=806971add41ef766; The harness exercised sole and ambiguous bare decisions, explicit-ID selection, non-owner and forged-club rejection, and owner reassignment across DM, restricted-channel, and group-invite paths.
    Evidence:
  • fixed/denied: ambiguous bare, non-owner, forged-club-owner, and former-owner decisions; status=pass; protected sink/source result: zero_calls; calls=0; Transport-observed counters remained at zero for protected effects after ambiguous bare decisions across all three request types, non-owner and forged-club-owner attempts, and a former-owner attempt after reassignment.; artifact: proof-output.json; excerpt: denied.status=pass; denied.call_rejected=true; denied.execution_calls=0; ambiguous DM, channel, group, and replay assertions=true
  • control: sole-pending and ID-qualified owner approvals; status=pass; intended behavior: success; The sole-pending bare owner decision produced exactly one selected effect; ID-qualified owner decisions affected only the selected DM, channel, or group request; after an owner settings update, only the replacement owner could approve.; artifact: proof-output.json; excerpt: compatibility.status=pass; compatibility.execution_calls=1; control.status=pass; owner_reassignment.status=pass; former_owner_execution_calls=0; replacement_owner_execution_calls=1
    Compatibility/operator note: Bare approve, deny, and block remain valid when exactly one request is pending. With multiple pending requests they return ID guidance and have no authorization effect; ID-qualified commands retain their prior effects, and existing pending request IDs remain valid across restart.
    Third-party gaps: none; proof requiring a third party blocks for assistance instead of contacting it.
    Proof pack digest: sha256:fed337c897d24a6aa48cf9a7c94f1c00d52783af4388ce0f98607c4e913fcb3b

@clawsweeper

clawsweeper Bot commented Oct 27, 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.

@mmaps
mmaps marked this pull request as ready for review October 27, 2026 19:27
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: tlon Channel integration: tlon size: S labels Oct 27, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Require a request ID when multiple Tlon approvals are pending while preserving bare decisions for a sole request.

Example: ~bus and ~sampel both have pending DM requests when the owner replies approve.

  • Before: The newest request is approved, potentially granting access to the wrong ship.
  • After: Neither request changes; the owner receives request IDs and can explicitly select one.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, correct fix with production-transport boundary proof and green exact-head checks; repeated wording tests add avoidable maintenance.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The exact-head proof in the PR body exercises monitorTlonProvider with the real Urbit HTTP/SSE client against a local transport fixture: sole and explicit-ID controls succeed, ambiguous decisions produce no protected effects, and non-owner, forged-club, and reassigned former-owner decisions are rejected; this proves the production approval boundary without a live Tlon service.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An owner can unintentionally approve, deny, or block a different pending request after another request arrives.
Reason: The maintainer-authored direction addresses a concrete authorization-targeting failure while keeping the existing single-request interaction.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it fixes approval mis-targeting still present on main, with no introduced correctness or security finding.

Priority: P1
Reviewed head: 113b48089253396599a9a7ed4e0ead5da856d4b0

Before merge

None.

Findings

None.

Tests

  • Low-value test extensions/tlon/src/monitor/approval.test.ts: The added three-row formatting group repeats exact wording assertions over the same shared instruction helper; remove it while retaining approval-effect regressions.
Agent review details

How this fits together

The Tlon monitor receives Urbit events, authenticates owner replies, and passes decisions to the approval runtime, which updates access settings, joins groups, blocks ships, or replays approved messages.

flowchart TD
  A[Urbit HTTP and SSE] --> B[Tlon monitor]
  B --> C[Verified owner DM]
  C --> D[Approval selector]
  D --> E[Ambiguous request guidance]
  D --> F[Selected approval effects]
  F --> G[Settings and Urbit operations]
Loading

Technical review

Best possible solution:

Use the existing approval selector to reject ambiguous bare decisions, return selectable IDs, and preserve sole-request and explicit-ID behavior.

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

Current main deterministically selects the newest of multiple pending requests for a bare decision; supplied channel and group regressions report failing on the base and passing on the head, but this review ran no target code.

Is this the best way to solve the issue?

The patch fixes targeting at its existing shared owner, covers all three approval types, and preserves the concise single-request workflow without new state or configuration.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Approval selection and owner prompts changes intended behavior with a stated reason (f468274: The original approval feature supported both newest-request bare decisions and specific IDs; this PR explains the mis-targeting risk and limits only the ambiguous form.)
  • Pending queue compatibility changes intended behavior with a stated reason (4f412cd: The queue-cap repair preserved every existing approval and its targeting context; this PR keeps those records and IDs while deliberately changing ambiguous bare replies.)
  • Club sender authority and replay provenance keeps the original intent (0538c07: Unverified group DM authors must never inherit owner authority; the patch preserves that ingress and replay boundary.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Current main still selects the newest request: The fetched main implementation returns the final pending approval when no ID is supplied; the PR instead permits that form only for exactly one pending request. (extensions/tlon/src/monitor/approval.ts:96, a1859e5195f6)
  • Pinned introduced change: The complete introduced diff changes the existing selector, owner guidance, documentation, and affected regressions without adding a second approval owner or changing persisted record fields. (extensions/tlon/src/monitor/approval-runtime.ts:221, 113b48089253)
  • Owner authority remains at ingress: Only a verified direct message matching the current effective owner reaches handleApprovalResponse; club author claims cannot enter this owner path. (extensions/tlon/src/monitor/index.ts:906, 113b48089253)
  • Transport and final-effect proof: The full PR body supplies exact-head local HTTP/SSE results: ambiguous DM, channel, and group decisions have zero protected effects; sole and ID-qualified controls succeed; non-owner, forged-club, and former-owner attempts are denied after owner reassignment. No real Tlon service was used. (113b48089253)
  • Prior queue contract: fix(tlon): bound pending approval queue #160679 deliberately preserved existing approvals and newest-request bare replies; this PR explains why ambiguous targeting must change while retaining all records and explicit IDs. (extensions/tlon/src/monitor/index.test.ts:325, 4f412cd5d3b1)
  • Exact-head checks: The fully paginated check-run response contains no failing or pending runs; openclaw/ci-gate and the changed extension test lane succeeded, and GitHub reports the reviewed head mergeable and clean. (113b48089253)

PR surface

Source +10, Tests +125, Docs +2. Total +137 across 8 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 22 12 +10
Tests 5 134 9 +125
Docs 1 10 8 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 166 29 +137

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P1: An ordinary delayed owner reply can grant access, join a group, or block a different requester when another approval arrives.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Remove the repeated exact-wording formatting tests while retaining the approval-effect regressions.

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 execution lanes are retired.

History

Review history (8 earlier review cycles)
  • reviewed 2026-10-27T19:44:05.736Z sha 1aabe6f :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-27T21:09:54.614Z sha 1aabe6f :: needs maintainer review before merge. :: none
  • reviewed 2026-10-27T21:17:53.010Z sha 632354b :: needs changes before merge. :: none
  • reviewed 2026-10-27T21:36:41.725Z sha 8b536d7 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-28T15:17:13.162Z sha aff8ef6 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-28T15:32:29.533Z sha aff8ef6 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-28T16:08:43.080Z sha 113b480 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-28T16:19:17.713Z sha 113b480 :: needs maintainer review before merge. :: none

Reviewed October 28, 2026, 12:26 PM ET / 16:26 UTC (Revision 9).

@mmaps

mmaps commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. 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. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 27, 2026
@mmaps

mmaps commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed 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. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 28, 2026
@mmaps

mmaps commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. clawsweeper:intake:bug Preliminary submission classification; full source review pending. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: tlon Channel integration: tlon docs Improvements or additions to documentation P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

1 participant