Skip to content

feat(api): Probe for @ mentions in TUI append to prompt API#3996

Open
ewired wants to merge 2 commits intoanomalyco:devfrom
ewired:tui-append-stuff
Open

feat(api): Probe for @ mentions in TUI append to prompt API#3996
ewired wants to merge 2 commits intoanomalyco:devfrom
ewired:tui-append-stuff

Conversation

@ewired
Copy link
Copy Markdown
Contributor

@ewired ewired commented Nov 6, 2025

1.0 removed the ability for POST /tui/append-prompt to include @ mentioned files and agents. This patch extracts and uses the mention resolution for files and agents used by command templates, marking the mentions as if they were added from Autocomplete. The behavior of the append prompt TUI command is also changed to move the cursor to the end before inserting, and I don't know if pre-1.0 versions did this. Unlike Autocomplete, it can resolve files relative to the home directory mentioned with ~/, which might be undesired.

Fixes #2129

@ewired ewired marked this pull request as draft November 6, 2025 18:29
@ewired
Copy link
Copy Markdown
Contributor Author

ewired commented Nov 6, 2025

The only failing test is failing on other recent PRs and pertains to the patch tool which is apparently dead code.

@ewired ewired marked this pull request as ready for review November 6, 2025 18:35
@ewired ewired marked this pull request as draft November 12, 2025 14:27
@ewired
Copy link
Copy Markdown
Contributor Author

ewired commented Nov 12, 2025

The original approach of this PR is incompatible with opencode after 4bb7ea9 because an Instance instance is apparently no longer provided to the TUI renderer or TUI command handlers. This can be based on the new SessionPrompt.resolvePromptParts method added from #4221 but it also uses Instance.

@ewired ewired marked this pull request as ready for review November 13, 2025 19:48
@ewired
Copy link
Copy Markdown
Contributor Author

ewired commented Nov 13, 2025

The new approach adds the ability to specify parts on TuiEvent.PromptAppend and must extract the mentions using the Instance information during the response to /tui/append-prompt. This means /tui/append-prompt has different capabilities than TuiEvent.PromptAppend and couldn't be a direct pass-through anymore.

@ewired ewired force-pushed the tui-append-stuff branch 4 times, most recently from 030d134 to 8770aaa Compare November 18, 2025 02:14
@github-actions github-actions bot force-pushed the dev branch 3 times, most recently from f1dc981 to 3e15a39 Compare November 22, 2025 18:07
@github-actions github-actions bot force-pushed the dev branch 2 times, most recently from df8bdf9 to 0dd5039 Compare November 22, 2025 18:21
@ewired ewired force-pushed the tui-append-stuff branch 2 times, most recently from e947abb to 07f200c Compare November 26, 2025 18:04
@ewired ewired force-pushed the tui-append-stuff branch 3 times, most recently from f28deb9 to c8e214a Compare December 11, 2025 02:00
@ewired ewired changed the title Probe for @ mentions in TUI append to prompt command feat(api): Probe for @ mentions in TUI append to prompt API Jan 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@ewired ewired force-pushed the tui-append-stuff branch from ab8f9c1 to a385fd6 Compare April 11, 2026 03:58
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.

Support for line range with file tagging?

1 participant