Skip to content

fix: workspace Markdown evidence links open missing conversations - #186642

Merged
shakkernerd merged 8 commits into
mainfrom
workspace-markdown-relative-links
Oct 29, 2026
Merged

shakkernerd merged 8 commits into
mainfrom
workspace-markdown-relative-links

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #186640

What Problem This Solves

A workspace Markdown report can contain a relative evidence link such as evidence/log.md#details. Clicking it in Files resolves against the browser’s chat URL and opens a nonexistent conversation, even though the intended file is readable through the file browser.

User Impact

Authored relative links now open the intended file from the report’s directory, including extensionless files and repository-backed previews without a host filesystem root. Files beyond the inline preview limit retain their metadata and download action. The report remains available in its tab, and existing drafts retain their contents. A heading fragment selects the file without adding heading scrolling.

Reads preserve the originating session and current permissions. A changed workspace is refused before another file or cached draft is selected; a missing or denied target restores the report’s catalog selection. Ordinary message links, external URLs, conversation links, fragment-only links, and the Markdown remote-image policy keep their existing handling.

Why This Change Was Made

Files already owns the document’s canonical path and read context. Its renderer opts into document-relative file links, and the existing navigation owner resolves the destination and checks the native source receipt before selecting a preview. The renderer’s cache distinguishes document readers from ordinary messages; host paths stay outside rendered link metadata. Failed navigation publishes the restored selection through the same workspace owner.

Repository reads populate the existing optional source receipt with their workspace ID and null filesystem roots. This distinguishes a retained document from a replacement repository after a source key is reused, while keeping identity stable across ordinary checkpoints. Save and conflict-recovery consumers use that receipt; clients omitting the optional source precondition retain their existing behavior. Request schemas and filesystem grants are unchanged.

Preview-limit errors retain the same optional root/source metadata in their existing details. The UI validates it against the existing file-response schema and keeps it in the download fallback. Error codes, the preview limit and oversized-write behavior remain unchanged.

Evidence

The original native guest report reproduced the wrong conversation destination, and the application regression failed after the click on the base. Corrected reads preserve the target bytes, source tab, conversation URL and workspace identity. Controls cover keyboard activation, parent paths, encoded filename delimiters, extensionless files, missing and escaping targets, source replacement and dirty-target reuse.

Native repository create/delete/create and active/stored-reader tests establish source-key reuse and distinct repository identities. The real application harness with modeled Gateway replies verifies that a retained foreign report cannot select replacement-repository evidence. This is separate from the live guest filesystem proof and makes no live cloud-placement claim.

The final refusal comparison uses the same real Gateway, guest, report and absent target. Before the correction, session_file_not_found leaves the report visible but clears its catalog selection; UI 2a492b7 restores that selection. Native readback confirms the report and workspace identity, and independent filesystem readback confirms all seven fixture files, modes and configuration unchanged. A delayed Access denied application regression separately verifies the same recovery with modeled Gateway replies.

Changed-file formatting/lint, generated-validator freshness, package boundaries and selected types pass. The broader correction qualified 403 cases across 27 affected files; integration qualified 227 cases across 14 files. The final refusal correction passed 126 cases across six files, including all ten file-link browser cases. These are successive scoped runs, with unchanged results retained at their recorded revisions. Current-head hosted tests, build, lint and types passed; the baseline-ratchet job reports 14 unrelated mock-export failures reproduced on the unchanged target ancestry with matching causal inputs. Its aggregate CI gate remains red under that attribution.

The native oversized-file proof preserves the 300 KiB file’s preview-limit error, opens its metadata/download panel, downloads the exact original bytes and returns to the report. Earlier captures retain their actual revisions: normal navigation at UI 2cfdf0e, and oversized download at UI/Gateway 6d13fb3. Source and consumer checks qualify their continued applicability; they are not pixel-identical captures of the current shell.

Visual evidence

Open preview

View Before After
Desktop file navigation An evidence link incorrectly opens a missing conversation The report link opens the intended evidence file beside the conversation
Repository replaced while a report remains open A retained report incorrectly opens evidence from a replacement repository The retained report stays open and the changed workspace is refused
Oversized text evidence (300 KiB) A report link incorrectly reports a workspace change and hides the download fallback The same report link opens the large-file metadata and download action
Refused document link restores the catalog selection The report stays open after a missing-file error, but its Files catalog row is no longer selected The same missing-file error leaves the report selected in Files and its contents visible

Native missing-file refusal restores the report selection

refusal-focused.webm

Visual verification

  • Baseline: 01d66c7 (normal navigation); 40ba28a2b98e86f74cf437755bb44a56d07db031 (source replacement); a0cf45b UI with c1d0ecb Gateway (oversized read); 6d13fb3 UI (refusal owner byte-identical to c390ffa)
  • Exact head: 2a492b773e3ad1e8a280e32ac8c78805129fa8f3
  • Scenario: Follow document-relative evidence links, preserve source identity and downloads, and restore the report selection when a link is refused.
  • Runtime/build: Refusal after-proof: UI 2a492b7; unchanged real Gateway 6d13fb3, build 2026.10.8-6d13fb3e8359-2026-10-28T16-19-08.023Z. Before UI uses 6d13fb3 with the same Gateway. Earlier comparisons retain their stated execution revisions.
  • Fragment-bearing evidence link: Correct file and unchanged conversation URL
  • Source and target integrity: Seven synthetic files preserved; originating workspace identity retained
  • Additional native controls: Keyboard, parent-directory, extensionless, missing and denied targets, fragment-only and session links
  • Oversized read contract: Same INVALID_REQUEST/session_file_too_large and 256 KiB preview limit; optional source metadata retained
  • Original download bytes: 307,200 bytes downloaded with the same SHA-256 before and after
  • Refused-link catalog selection: Report aria-current is absent after the native refusal before the fix and true afterward; report content and conversation URL remain unchanged
  • Native guest identity, read scopes and workspace verified independently.
  • The same authored report and absent target are used before and after; no fixture or model turn was added.
  • The native Gateway rejects the missing file with INVALID_REQUEST/session_file_not_found. Both captures keep the report visible and the conversation URL unchanged.
  • The baseline preview owner is byte-identical to c390; the corrected served module matches committed 2a492 source and direct Vite output.
  • The original report content and source identity were read back through the native RPC after each interaction.
  • The model selector is masked identically; the report, authored link, refusal and catalog selection remain visible.
  • Oversized before uses A0 UI and the unchanged c1d0 failure owner; after uses the actual corrected 6d13 Gateway/UI and native RPC/HTTP receipts.
  • Normal navigation was captured through the real guest Gateway at UI 2cfdf0e. Repository replacement was captured at d175a33 with modeled Gateway replies and separate native repository tests; it is not a live cloud-placement claim.
  • Earlier captures retain their original revisions and qualified behavior. They are not presented as pixel-identical current shell frames.
  • The delayed Access denied application regression uses modeled Gateway replies and separately supports the native missing-file proof.

@clawsweeper

clawsweeper Bot commented Oct 28, 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 docs Improvements or additions to documentation app: web-ui App: web-ui size: M labels Oct 28, 2026
@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. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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
@clawsweeper

clawsweeper Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Resolve authored relative Markdown links from the opened document’s directory while preserving source identity, drafts, and oversized-file downloads.

Example: Open reports/review.md and click Evidence.

  • Before: The browser opens a nonexistent conversation.
  • After: Files opens reports/evidence/log.md while retaining the report tab and conversation.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, source-correct repair with strong visible behavior proof and the prior finding resolved; CI failure attribution remains incomplete.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after screenshots show native Files navigation, oversized-file fallback, and current-head catalog restoration after refusal; repository replacement captures explicitly use modeled Gateway replies and are supported by native repository-owner tests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Following a readable evidence link from a Markdown report leaves Files and opens a nonexistent conversation.
Reason: This restores expected document navigation using existing owners, and the maintainer-authored direction requires no additional product approval.

Merge readiness

✅ Ready for maintainer review

This PR fixes a concrete Files navigation bug still present on main and resolves the previous catalog-selection finding; no actionable code defects remain, but the aggregate CI gate is red.

Priority: P2
Reviewed head: 2a492b773e3ad1e8a280e32ac8c78805129fa8f3

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI Markdown renderer identifies document links, the existing workspace preview owner resolves them, and Gateway file services authorize reads from the originating session.

flowchart LR
  A[Markdown document] --> B[Document link renderer]
  B --> C[Workspace preview owner]
  C --> D[Gateway session authorization]
  D --> E[Filesystem or repository reader]
  E --> F[Source checked preview]
Loading

Technical review

Best possible solution:

Keep document-relative resolution and source validation in the existing Files owners, coordinating overlapping heading-link work with #185080.

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

Current-main source lacks document-relative context, matching the linked reproduction and inspected missing-conversation screenshot; no target code was executed during this review.

Is this the best way to solve the issue?

The smallest complete repair supplies document context to the existing renderer and preview owner, validates the original source before reuse, and retains metadata needed by the existing download fallback.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • File-link parsing and originating-session routing keeps the original intent (84f21bd: Introduce clickable workspace references; later routing work in c183920 preserved originating-session reads.)
  • Workspace source receipts keeps the original intent (a44dc77: Bind edits to the workspace and lookup roots originally read, refusing replacement targets while preserving drafts.)
  • Preview reuse and refusal settlement keeps the original intent (ecfd906: Refresh clean previews while retaining dirty drafts; subsequent owner refactors preserve selection and asynchronous settlement.)
  • File-reader presentation keeps the original intent (9e2c766: Keep reader controls separate from draft, save, file-identity, and preview-lifecycle ownership.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Shakker: Raw commit a44dc77 adds src/gateway/server-methods/sessions-files.ts:127 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: a44dc77340f8; files: src/gateway/server-methods/sessions-files.ts)
  • Peter Steinberger: Raw commit c183920 adds ui/src/pages/chat/components/chat-session-workspace.ts:198 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c183920e8fbc; files: ui/src/pages/chat/components/chat-session-workspace.ts)
  • Vyctor H. Brzezowski: Raw commit 9e2c766 adds ui/src/pages/chat/components/chat-detail-file-presentation.ts:20 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9e2c766d84ab; files: ui/src/pages/chat/components/chat-detail-file-presentation.ts)

PR surface

Source +168, Tests +360, Docs +11, Generated +3, Other +7. Total +549 across 30 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 16 192 24 +168
Tests 11 510 150 +360
Docs 1 12 1 +11
Config 0 0 0 0
Generated 1 3 0 +3
Other 1 7 0 +7
Total 30 724 175 +549

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #186640
Summary: The linked issue establishes the document-context defect; another open PR overlaps relative-link handling while adding heading navigation.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Broken report-to-evidence navigation affects a bounded Files workflow, with recovery through the existing file browser.
  • 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.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rank-up moves

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

  • Verify the mock-export failure against unchanged ancestry, then resolve the aggregate gate through the repository’s normal CI handling.

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 (4 earlier review cycles)
  • reviewed 2026-10-28T08:45:42.666Z sha 5e13385 :: needs changes before merge. :: [P2] Bring the added regressions within the test-line ratchet
  • reviewed 2026-10-28T14:36:22.901Z sha a0cf45b :: needs changes before merge. :: [P2] Preserve oversized-file downloads during source validation
  • reviewed 2026-10-28T16:52:53.068Z sha 6d13fb3 :: needs changes before merge. :: none
  • reviewed 2026-10-28T22:40:55.125Z sha c390ffa :: needs changes before merge. :: [P3] [P3] Publish the restored workspace state after a refused link

Reviewed October 28, 2026, 8:54 PM ET / October 29, 2026, 00:54 UTC (Revision 5).

@shakkernerd
shakkernerd force-pushed the workspace-markdown-relative-links branch from 35ab2d4 to a0cf45b Compare October 28, 2026 14:28
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: L and removed size: M labels Oct 28, 2026
@shakkernerd

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. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 28, 2026
@clawsweeper clawsweeper Bot removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 28, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Oct 28, 2026
@shakkernerd

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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 28, 2026
@shakkernerd

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 29, 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. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 29, 2026
@shakkernerd shakkernerd self-assigned this Oct 29, 2026
@shakkernerd
shakkernerd merged commit f0401d5 into main Oct 29, 2026
143 of 147 checks passed
@shakkernerd
shakkernerd deleted the workspace-markdown-relative-links branch October 29, 2026 01:03
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: Workspace Markdown evidence links open the intended file while preserving source context, read checks and unsaved drafts.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 29, 2026
…enclaw#186642)

Workspace Markdown evidence links now open the intended file while preserving document context, native access checks, and unsaved drafts.

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

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: L 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.

[Bug]: Files Markdown evidence links open a missing conversation

1 participant