Skip to content

fix: resolve #639#641

Closed
inference-gateway-maintainer[bot] wants to merge 7 commits into
mainfrom
pr-640
Closed

fix: resolve #639#641
inference-gateway-maintainer[bot] wants to merge 7 commits into
mainfrom
pr-640

Conversation

@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

Resolves #639

Summary

The agent's original PR description was incomplete, so this summary was generated from the commit history.

Changes

edenreich and others added 7 commits June 20, 2026 19:59
Discover Agent Skills from the open-standard .agents/skills/<name>/SKILL.md
in addition to project .infer/skills/ and user-global ~/.infer/skills/.
Precedence is project > agents > user (first match wins on name collision),
so a repo that ships skills under the cross-tool .agents/skills/ convention
works without moving them into .infer/skills/.

- domain: add SkillScopeAgents scope value
- config: add AgentsDirName; carve .agents/skills out of the sandbox so
  SKILL.md and references/*.md read even under a restrictive sandbox
  (parity with .infer/skills)
- skills: insert .agents/skills into searchScopes, between project and user
- cmd/skills + docs/skills + docs/directory-structure: document the location

Closes #639
Centralized-config changes in one PR:

1. Adds/updates `.github/workflows/infer.yml` as a thin caller of the
org reusable workflow
   `inference-gateway/.github/.github/workflows/infer.yml@v0.11.3`,
wiring the `@infer` bot (inference-gateway/infer-action) into this repo.
2. Bumps this repo's Flox `infer` pin (`.flox/env/manifest.toml`) to
   `v0.121.1` (the latest `inference-gateway/cli` release) and
   refreshes `.flox/env/manifest.lock`.
3. Regenerates the committed `.infer/` config with `infer init
--overwrite --skip-migrations`
   using that CLI.

Setup lives centrally, so future moves (action bump, model, tool scope,
CLI version) are a
**re-run of `migrate-infer.yml`** instead of a hand-edit per repo.

Ran in CI (mirrors `bump-adl.yml`):
- sed the `inference-gateway/cli` pin in `.flox/env/manifest.toml` to
the latest release
- `flox upgrade infer` + `flox activate` to refresh
`.flox/env/manifest.lock`
- `flox activate -- infer init --overwrite --skip-migrations` to
regenerate `.infer/`

> **Heads-up:** `infer init --overwrite` resets `.infer/` to CLI
defaults. `.infer/agents.yaml`
> and `.infer/mcp.yaml` (this repo's A2A agents registry + MCP servers)
are **preserved**
> byte-for-byte; every other config file (`config.yaml`, `prompts.yaml`,
`keybindings.yaml`,
> `channels.yaml`, `computer_use.yaml`, `heartbeat.yaml`, `shortcuts/*`)
is regenerated.
> `.infer/bin`, `logs`, history and the conversations DB stay out via
the nested
> `.infer/.gitignore`. Review the diff before merging.

- Triggers on `@infer` mentions in issues / issue comments. Default
model
`deepseek/deepseek-v4-flash`. The `infer-action` pin lives in the
reusable `infer.yml`.
- Also adds a manual `workflow_dispatch` form: from this repo's Actions
tab pick **Infer**,
type a free-text `prompt`, and the bot works it in that run and opens a
PR (no issue
  needed) - mirroring the `@claude` workflow.
- Tools = infer-action's default bash whitelist + the language preset (+
markdownlint where
set), configured in `repos.yaml` (the entry's `orchestrators.infer`
block).
- Requires the maintainer GitHub App
(`INFERENCE_GATEWAY_MAINTAINER_APP_ID` /
`INFERENCE_GATEWAY_MAINTAINER_APP_PRIVATE_KEY`) installed on this repo
plus the provider
API-key secrets; both reach the reusable workflow via `secrets:
inherit`.

Filed by
[migrate-infer.yml](https://github.com/inference-gateway/.github/blob/main/.github/workflows/migrate-infer.yml).

Co-authored-by: inference-gateway-maintainer[bot] <246577062+inference-gateway-maintainer[bot]@users.noreply.github.com>
…actoring (#637)

Extends `/explorer` so you can browse a file, select a line range,
optionally annotate it, and pull those lines into chat as **attached
context** — part of making the CLI usable without reaching for a
separate IDE. Selected snippets appear as a tree of file + line ranges
below the chat input and are sent (selected lines only) with your next
message.

Closes #599.

In `/explorer`, with a file previewed:

- `s` — enter line-select mode
- `↑/↓` (`j/k`) move the line cursor; `space`/`v` mark a range
- **`enter` attaches the selected range immediately** (annotation
optional)
- `a` — add an optional natural-language note to the range, then `enter`
attaches it
- `esc` backs out of select mode; `esc`/`q` closes the explorer
**carrying** the attachments to chat; `ctrl+c` discards

Back in chat, attachments render as a tree (file + line ranges only)
below the input. Multiple explorer trips accumulate. Manage them with:

- `ctrl+g` — focus the tree
- `↑/↓` move · `d` remove one · `c` clear all · `esc` leave

On send, the **selected lines** (fenced, headed `path (lines X-Y):`,
with the optional `note:`) are appended to your message and the tree
clears. Slash/bash commands are not augmented, so attachments persist
for the next real message. Empty input + attachments is a valid send.

- **`internal/ui/components/file_explorer.go`** — `SnippetSelection`
type + select-mode state. `enter` attaches the current range immediately
(no required annotation); `a` adds an optional note. `esc`/`q` closes
carrying selections, `ctrl+c` discards. `FormatAnnotations()` now emits
**only the selected lines** (fenced, with a `path (lines X-Y):` header +
optional `note:`) — not the whole file or a context window.
- **`internal/ui/components/snippet_attachments_view.go`** *(new)* —
`SnippetAttachmentsView`: renders pending attachments as a focusable
tree (file parents, line-range children) with cursor/remove/clear and
width-aware path truncation.
- **`internal/ui/components/application_view.go`** — renders the
attachments tree directly below the input, with height accounting so the
input isn't pushed off-screen.
- **`internal/app/chat.go`** — pending-attachments state; explorer close
**carries** selections into chat (instead of dumping a blob into the
input box); `ctrl+g` focus shim with nav/remove/clear; `SendMessage`
appends the selected-lines block at send time and clears it (skipped for
slash/bash commands).
- **`config/keybindings.go`** — explorer
`select`/`toggle_select`/`annotate`/`submit` actions +
`chat.focus_attachments` (`ctrl+g`).
- **Tests** — formatter (selected-lines-only), the attachments tree
(grouping, cursor→index mapping, clamp), explorer keys (enter-attaches,
close-carries), and the send-path gating/concatenation.

- **Attached context, not input injection** — snippets land as a
reviewable tree of file + line ranges below the input and are sent with
the next message, instead of overwriting whatever you'd typed.
- **Selected lines only** — exactly the chosen range is sent (no
whole-file or context-window dump), keeping token use tight and the
model's focus precise.
- **Line-based selection** — deterministic and language-agnostic (no
tree-sitter dependency). Syntax-tree-node selection remains a future
enhancement.
- **Optional annotations** — `enter` attaches immediately; `a` adds a
per-snippet note when wanted. The tree shows only file + lines.

- [x] `/explorer` supports a snippet-selection mode on an open file.
- [x] Select a line range, rendered with a distinct gutter style.
- [x] Attach an optional natural-language annotation.
- [x] Selections stored as `(file, start_line, end_line, annotation)`.
- [x] The selected lines (+ annotation) reach the LLM — sent with the
next message.
- [x] Multiple disjoint selections within one file and across files.
- [x] Tests cover selection, attachment, the tree, and the send path.

- `golangci-lint run` → 0 issues
- `go test ./...` → all pass
- `gofmt` / pre-commit hooks → pass

None. CLI-internal TUI feature; docs added in-repo under
`docs/features/`.

```bash
task test
go test ./internal/ui/components/... ./internal/app/...
```
Co-authored-by: Eden Reich <eden.reich@gmail.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: read skills also from .agents/skills/<skill name> (open standard)

1 participant