Skip to content

fix: keep @ file references available in /skill argument text#340

Open
ShreyanshVaibhaw wants to merge 1 commit into
huggingface:mainfrom
ShreyanshVaibhaw:fix/at-reference-after-skill-316
Open

fix: keep @ file references available in /skill argument text#340
ShreyanshVaibhaw wants to merge 1 commit into
huggingface:mainfrom
ShreyanshVaibhaw:fix/at-reference-after-skill-316

Conversation

@ShreyanshVaibhaw

Copy link
Copy Markdown
Contributor

Summary

Fixes #316.

Opening this after claiming the issue two days ago; the reporter confirmed the exact reproduction in the meantime (/skill:foo @ on the same line shows no completions). Happy to adjust or close if a different fix is planned.

Root cause

Not stale state - a routing gap in build_completion_state (src/tau_coding/tui/autocomplete.py). Any text starting with / never reaches the @ file completer, and a matched /skill: command with argument text returned an empty completion state. So @ references, which work in normal prompt text, offered nothing inside a skill invocation.

Fix

Skill arguments are prompt text, so that branch now falls through to the file-reference completer (the TUI already passes cwd, so it works end to end):

if token.startswith("/skill:"):
    if has_argument_text and _matches_skill_command(token, skills):
        # Skill arguments are prompt text, so @ file references stay available.
        if cwd is not None:
            return CompletionState(_file_reference_completions(text=text, cwd=cwd))
        return CompletionState()

/skill:review fix @app now suggests @src/app.py. Generic slash commands like /help @read keep completions off - that behavior is deliberate and its existing test (test_file_reference_completion_stays_off_for_slash_commands) is untouched.

Scope note

The reporter also raised skill chaining (/skill:foo /skill:bar in one line). That is new command-parsing semantics rather than a completion-routing bug, so it is deliberately out of scope here (noted on the issue).

Tests

  • New regression test test_file_reference_completion_works_in_skill_command_arguments, written first and confirmed failing before the fix.
  • Full tests/test_tui_autocomplete.py: 30 passed. ruff and mypy clean. Rebased on current main.

🤖 Generated with Claude Code

A matched /skill command with argument text returned an empty
completion state, so typing @ to reference a file inside a skill
invocation offered no suggestions. Skill arguments are prompt text, so
fall through to the file-reference completer there. Generic slash
commands keep completions off, matching the existing tests.

Fixes huggingface#316
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.

File reference doesn't work after skill invocation

1 participant