Skip to content

feat: add at_filename usage for users to directly involve a filepath to context#40

Open
Dong1017 wants to merge 5 commits intovigo999:refactor-arch-4.21from
Dong1017:refactor-arch-4.21
Open

feat: add at_filename usage for users to directly involve a filepath to context#40
Dong1017 wants to merge 5 commits intovigo999:refactor-arch-4.21from
Dong1017:refactor-arch-4.21

Conversation

@Dong1017
Copy link
Copy Markdown
Collaborator

Summary

Add @filename prompt support so users can reference workspace files directly from chat and selected slash commands.

What’s Included

  • Added @relative/path expansion for:
    • Plain chat
    • /report
    • /diagnose
    • /fix
    • /skill <name> ...
    • /<skill> ... aliases
  • Added @file suggestions in the input composer
  • Added backend validation for referenced files
  • Expanded @file into a workspace file marker:
    • [file path="<absolute workspace path>"]
  • Let the agent decide whether to read file contents through filesystem tools instead of auto-inlining content

Behavior

  • Only standalone whitespace-delimited @relative/path tokens expand
  • @@name keeps a literal @name
  • Paths must stay inside the workspace
  • Referenced targets must exist and be files
  • Invalid @file references fail the whole input

Implementation

  • Added input expansion flow for supported command surfaces
  • Added shared workspace file path validation
  • Updated tools/fs path handling so agent-side reads work with workspace absolute paths
  • Updated help text and docs for the new @filename workflow

Files Changed

  • internal/app/input_expansion.go
  • internal/workspacefile/workspacefile.go
  • tools/fs/pathutil.go
  • tools/fs/pathutil_test.go
  • internal/app/commands.go
  • internal/app/input_expansion_test.go
  • ui/app_train_test.go
  • docs/at-file-input-expansion-summary.md

Testing

  • go test ./internal/app -run 'Test(ExpandInputText|ProcessInput|HandleCommand)'
  • go test ./tools/fs -run 'TestResolveSafePath'
  • go test ./ui -run 'TestAtFileInputWaitsForBackendEchoBeforeShowingUserMessage|TestEnterAcceptsAtFileSuggestionBeforeSubmittingToBackend'

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.

1 participant