Skip to content

feat(web): @ autocomplete to cite other sessions by title - #1217

Merged
tiann merged 6 commits into
tiann:mainfrom
heavygee:feat/session-at-mention-autocomplete
Jul 29, 2026
Merged

feat(web): @ autocomplete to cite other sessions by title#1217
tiann merged 6 commits into
tiann:mainfrom
heavygee:feat/session-at-mention-autocomplete

Conversation

@heavygee

Copy link
Copy Markdown
Collaborator

Summary

  • Composer @ fuzzy-ranks fleet session titles (and id prefixes) and inserts the same plain-text citation as Copy reference (See session "…" (/sessions/<id>) for context).
  • Works for all agent flavors; Codex file @ mentions still work and follow session hits.
  • Bare /sessions/<id> paths in chat markdown autolink for in-app navigation.
  • Rejects dotted tails so source paths like routes/sessions/chat.tsx stay file-path links.

Out of scope (v2): rich/segmented composer with inline session tokens. Attachment-style chips were dogfooded and reverted — they cannot express positional "this clause → session A" intent.

Fixes #1213

Test plan

  • bun typecheck
  • cd web && bun run test (sessionReference + remark-session-path-links + suite)
  • cd hub && bun run test
  • Type @ + partial session title → citation text inserted
  • Codex session: @ still offers files after sessions
  • Click /sessions/<id> in transcript → SPA navigate
  • Prose mentioning web/src/routes/sessions/chat.tsx still file-autolinks

heavygee and others added 4 commits July 28, 2026 16:02
Composer @ ranks fleet session titles (and id prefixes), inserting the
same Copy-reference citation grammar. Codex file @ mentions remain and
follow session hits. Bare /sessions/<id> paths autolink for in-app nav.

Closes tiann#1213.

Co-authored-by: Cursor <cursoragent@cursor.com>
Selecting a session from @ autocomplete adds an attachment-style chip
(flavor + title + active dot) instead of expanding prose in the textarea.
On send, chips serialize to markdown session links that render as chips
in the transcript.

Part of tiann#1213 dogfood.

Co-authored-by: Cursor <cursoragent@cursor.com>
Attachment-style composer chips cannot express positional
"this → session A / that → session B" intent. Keep @ autocomplete
and Copy-reference text insert for v1; rich segmented composer is v2.

Part of tiann#1213.

Co-authored-by: Cursor <cursoragent@cursor.com>
Reject dotted session-id tails and stop treating `.ext` as a soft path
end so citations like `routes/sessions/chat.tsx` stay file-path links.

Part of tiann#1213.

Co-authored-by: Cursor <cursoragent@cursor.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Findings

  • [Major] Session citation anchors drop the configured Vite base path — buildSessionReferencePath() emits BASE_URL-prefixed citations and parseSessionPathHref() accepts those paths, but the rendered anchor rewrites every match to root /sessions/<id> at web/src/components/assistant-ui/markdown-text.tsx:515. In documented static-hosted builds under a subpath, copy/open-in-new-tab/modified clicks on these new citation links leave the PWA scope or 404 instead of preserving /repo/sessions/<id>.
    Suggested fix:
    import { buildSessionReferencePath } from '@/lib/sessionReference'
    
    const href = buildSessionReferencePath(props.targetSessionId)

Summary

  • Review mode: initial
  • One issue found: BASE_URL-prefixed session citations are parsed but then rendered as root-relative links. Residual risk: no browser-level coverage for subpath-hosted markdown session links.

Testing

  • Not run (automation)

HAPI Bot

Comment thread web/src/components/assistant-ui/markdown-text.tsx Outdated
SessionPathAnchor href now uses buildSessionReferencePath so copy /
open-in-new-tab stay in the PWA subpath scope.

Co-authored-by: Cursor <cursoragent@cursor.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Findings
No issues found.

Questions
None.

Summary

  • Review mode: follow-up after new commits
  • The previous BASE_URL session-link finding is addressed in this head. Residual risk: no browser-level coverage for subpath-hosted markdown session links or manual composer autocomplete behavior.

Testing

  • Not run (review only)

HAPI Bot

Reuse the share/sidebar matcher (name + summary + path + id + machine)
while still labeling and inserting getSessionTitle (name before summary).

Co-authored-by: Cursor <cursoragent@cursor.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Findings
No issues found.

Questions
None.

Summary
Review mode: follow-up after new commits
No issues found in the full latest diff. Residual risk: coverage is limited to unit tests for session-reference ranking/parsing and the remark plugin; no browser-level coverage for composer autocomplete insertion or markdown SPA navigation.

Testing
Not run (review only)

HAPI Bot

@heavygee

Copy link
Copy Markdown
Collaborator Author

Proof (pr-attach-proof, release strategy — not user-attachments)

#1217 dogfood: @Upstream Feature → label share picker title parity (sessionMatchesQuery)

asset: heavygee/hapi@pr-attach-proof-1217/proof-2026-07-28T17-53-47-1217-at-dual-field-1785261221989.png · delete release after merge if desired

@tiann
tiann merged commit e32fe14 into tiann:main Jul 29, 2026
2 checks passed
@heavygee
heavygee deleted the feat/session-at-mention-autocomplete branch July 29, 2026 04:42
heavygee added a commit to heavygee/hapi that referenced this pull request Jul 29, 2026
Commit unfinished meta/fork WIP that was stranding hapi-sync-fork-main:
DROPPED tiann#1205/tiann#1217 soup layers + rich-composer tip note, Meta remat
playwright.config policy docs, hapi-from-active PATH wrapper + ping-peer
delegation, and in-use soup-heals 60/61.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(web): @ autocomplete to cite other sessions by title (v1 plain-text)

2 participants