Files
OpenResearch/ui
Daniel Kim 7940344d44 Open agent-inlined files-dir report links from chat (v0.1.76) (#116)
Clicking a report.md link an agent inlined into the chat transcript failed
with "path must be repo-relative": the report lives in the files dir
(<data dir>/files/<slug>/…), but every chat file-open routed through
parseFilePath → FileViewer → the repo /file endpoint, which rejects absolute
paths. parseFilePath had no files-dir case and FileViewer carried no source
discriminator, so files-dir artifacts were unroutable.

- Backend surfaces a (non-canonical) absolute filesDir on every project
  payload via a shared project_json helper, routed through all six emission
  sites including the SSE project.updated diff — enriching only list_projects
  would let a bare project clobber filesDir on the next visit.
- parseFilePath gains a files-dir branch: exact-prefix match against filesDir
  (byte-for-byte with the path the agent inlines), plus a /files/<slug>/
  suffix-regex fallback for symlink-divergent data dirs. Tabs it produces
  carry source:"files".
- FileViewer branches its fetch by source: files-dir reports via /files/report,
  other files via /files/file, else the repo endpoint. Files-dir markdown
  renders through FilesTab's ReportMd (now exported) so report-relative image
  paths resolve; a missing file shows a friendly not-found; repo-only notes are
  suppressed.

Verified end-to-end: the failing report.md chip now opens the report from the
files endpoint with no error.
2026-07-22 20:16:39 -07:00
..
2026-07-06 20:05:41 -07:00
2026-07-06 20:05:41 -07:00
2026-07-06 20:05:41 -07:00