Repository navigation
feat(agent): markdown subagent definitions in .infer/agents/<name>.md - #1348
Conversation
Load Claude Code / Gemini CLI style agent presets from .infer/agents/*.md and ~/.infer/agents/*.md at session start: frontmatter name/description/model/tools/disallowedTools, body as system prompt. Project files win on name collision; invalid files are skipped with a warning. The Agent tool gains an optional agent argument that applies the preset, and the resolved tool allowlist reaches the child via INFER_SUBAGENT_TOOLS, enforced in LLMToolService.isToolEnabled so disallowed tools are neither advertised nor executable.
|
@infer Is this feature ready? Can you record a demo that you create an agent in a directory and then you delegate a task to it use /tokenless |
|
Model: Todos
Pull Request✅ Infer Result: SuccessYes, the feature is ready. Demo recorded (embedded above as GIF by the runner): a What the demo shows (59s, recorded on this PR's build v0.210.0-7-g8e2ca0c8):
Verification (all green, run on the PR head at 8e2ca0c): Why I consider it ready beyond the checks: the demo exercised the real flow end-to-end - project-dir loading with user-dir precedence behind it, Known v1 limitations (all documented in docs/subagents.md): no hot reload (definitions load once per session - that's why the demo creates the file before launching Model: Tokens: 4,813,164 in · 58,556 out · 4,871,720 total (34 requests) Tool calls: 95 total · 100% success rate ArtifactsTracesStatsTriggered by edenreich · Infer Action · OSS |
|
@infer Does it also work if you create the agent in How can I see the currently available configured subagents? I know we have "/agents" but that's for A2A agents, we probably need another type of agents in the listing for "/agents" slash command. Can you add it and demo it? I want to see their types and their capabilities. |
|
Model: Todos
Pull Request
|
…stings Adds agentdomain.SubagentInfo and ToolService.ListMarkdownSubagents backed by the tool registry, so the TUI can list the loaded .infer/agents/*.md presets with name, description, model, tool allowlist, derived read-only type and project/user source.
Adds a dedicated subagents listing to the /agents shortcut: name, source (project or home), model, read-only vs read-write mode and the resolved tool allowlist are rendered alongside the existing A2A agents, backed by a new ListMarkdownSubagents ToolService method and SubagentInfo DTO.
|
@infer You couldn't finish the demo, it took too long, can you re-try to record a demo of the new listing agents slash command that you've just implemented? |
|
Model: Todos
Pull Request✅ Infer Result: SuccessDemo recorded: the new
|
|
@infer Can you review this PR? use /ponytail:ponytail-review /domain-driven-design /go /go-concurrency /bubbles-v2 /bubbletea-v2 I think for example that the A2A view and the sub agents view could be a single view with different types (markdown agent or code agent - a2a). Find good names for the types and add it to your review verdict. |
|
Model: Todos
Pull Request✅ Infer Result: SuccessAll review work is done: every changed file read, tests confirmed green ( Review: markdown subagent definitions (PR #1348)Overall: solid feature. The loader is conservative in the right places (invalid files warn and skip, never fail startup; empty allowlists never fall back to all tools; foreign vendor keys are tolerated), enforcement is advertise + execute in one gate, and the docs match the code claim-for-claim. Tests are table-driven and cover the env propagation on both headless and tmux paths. The only structural concern is the one you already suspected - and I agree with it. Your proposal: one view with types - yes, and here are the namesYou're right. Type names (added to the verdict, as asked):
Why these names (ubiquitous-language test):
DDD framing: this is a context map, not a god view. The two listings come from two bounded contexts (agent/tools and the A2A readiness port); the merged view composes two narrow read ports that already exist ( Rough effect: delete Ponytail (over-engineering) findings
Minor fixes (normal review)
Skill checks
VerdictMerge-worthy after the two minor fixes; the merged Agents view is a clean follow-up (or fold it in if you want the UX change here - I would split it to keep this PR reviewable). Type names for the single view: Model: Tokens: 2,613,198 in · 26,315 out · 2,639,513 total (21 requests) Tool calls: 37 total · 100% success rate TracesStatsTriggered by edenreich · Infer Action · OSS |
ExecuteTool and ValidateTool returned the generic "local tools are not enabled" for tools excluded by a Markdown subagent's allowlist, which told the model the tool was globally disabled and invited retries. Both paths now share allowlistRejection, which returns the tool name and the allowed set with an explicit do-not-retry hint.
…t unparseable
A malformed tools shape (e.g. tools: {Read: true}) used to silently grant the subagent all parent tools; a set-but-unparseable tools or disallowedTools key now skips the file with a warning, like every other invalid shape.
SubagentsView was the fourth line-identical copy of the filterable-list scaffold and mirrored the A2A wiring 1:1. One AgentsView now renders typed rows with local/a2a chips, composing the AgentReadiness and SubagentCatalog read ports at the presentation boundary, with /a2a kept as a pre-filtered alias and AgentStatusUpdateEvent still refreshing the a2a rows.
Resolving a review thread is GraphQL-only (resolveReviewThread), and `gh api graphql` was not in the bash allow-list, so headless runs were blocked when asked to "address this and resolve the comment" (inference-gateway/cli#1348). Append two scoped entries to GIT_WRITE_ALLOW: an anonymous GraphQL query (the spec forbids a mutation beside it) to look up the thread id, and the single resolveReviewThread mutation. Any other mutation, a second root field, or extra flags do not match. The PR system prompt gives the exact commands and resolves only threads the agent was asked to resolve and actually addressed.
## [0.53.2](v0.53.1...v0.53.2) (2026-09-27) ### Bug Fixes * let the agent resolve PR review threads it addressed ([#380](#380)) ([3e0998b](3e0998b)), references [inference-gateway/cli#1348](inference-gateway/cli#1348)
|
🎉 This PR is included in version 0.214.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## Summary `@infer /demo` on a PR (or `/demo` in chat) now has a procedure to follow: a new built-in `demo` skill, seeded into `~/.infer/skills` by `infer init` like `bug` and `tmux`. It records a short demo GIF of any project - CLI, TUI or GUI app - so it works in every org repo that runs infer-action with `record-demo`, desktop included. It replaces the demo procedure hardcoded in infer-action's `infer-action-record-demo` reminder (follow-up PR there shrinks it to a pointer to this skill). ## Why this shape Every rule comes from the 8 demo runs so far (#1355, #1348, #1359): | Observed | Skill rule | |---|---| | Procedure arrived at turn 28, after 3 takes and a committed `.mp4` (#1348) | "Record the demo" is the last todo, planned up front; recording after the work is pushed | | 4 GIFs in one comment - every probe take became a GIF (#1348, #1359) | Rehearse with `capture-pane` / Screenshot, record one take, convert only it to a fixed `~/.infer/artifacts/demo.gif` | | Take capped at 60 s before the interesting frame - one model turn per keystroke (#1359) | Whole take as one response of tool calls (`CallOrder` keeps them in order) | | Run died on `ImageDecode` of a GIF (API 400) (#1355, #1359) | Check a take via one PNG frame pulled with ffmpeg | | `pkill -f "infer chat"` matched the agent's own command line (#1355) | Quit with the app's own keys; no `pkill -f` / `killall` | | Own tmux sessions / xterms, not on the recorded display (#1348, #1359) | CI: only the `demo` session; GUI apps start there with `DISPLAY=:99` | | MP4 hard-linked into the repo and pushed (#1348) | `~/.infer/artifacts` is the delivery channel; recordings never enter the repo | | Wrong conclusions saved to memory in a run without recording (#1359) | No memories about demo mechanics - the skill is the source of truth | ## Changes - `internal/skills/builtins/demo/SKILL.md` - the skill - `internal/skills/builtins_test.go` - seeds and validates `demo`; description must route `/demo` - `docs/skills.md` - listed under built-in skills ## Verification - `go test ./internal/skills` green; pre-commit hook (mod:tidy, fmt, lint, markdownlint) passed on the commit - End-to-end check is `@infer /demo` on #1363 once this ships and infer-action/`.github` bump their CLI version ## Rollout 1. This PR, released (expected v0.215.0) 2. infer-action: reminder points at the skill, drops its own MP4->GIF conversion, allows `ffmpeg`, bumps default CLI version 3. `inference-gateway/.github`: bump `cli-version` and the infer-action tag Docs: follow-up `[DOCS]` issue for `inference-gateway/docs` still to be filed.





Resolves #1343
Summary
Adds Markdown subagent definitions compatible with Claude Code (
.claude/agents/*.md) and Gemini CLI (.gemini/agents/*.md): a file dropped into.infer/agents/or~/.infer/agents/defines a reusable subagent whose YAML frontmatter sets name, description, model and tool allowlist, and whose body is the system prompt. TheAgenttool gains an optionalagentargument that applies the preset, and the resolved tool allowlist is enforced in the spawned subagent via theINFER_SUBAGENT_TOOLSenvironment variable.Changes
internal/skills:parseFrontmattergeneralized into exportedSplitFrontmatter, returning the raw YAML block plus the body; skill loading behavior unchangedinternal/agent/tools/mdagent.go(new): loader scanning.infer/agents/*.mdthen~/.infer/agents/*.md(project wins on name collision); accepts YAML-list or comma-separatedtools, honorsdisallowedTools, drops unknown tool names with a warning, warns on non-provider-prefixedmodelvalues and falls back to inherit, accepts and ignores unknown keys (color,temperature,max_turns,maxTurns,mcpServers,permissionMode, ...); a restriction that resolves to no known tool skips the file with a warning naming the file and reason; invalid files never fail startupinternal/agent/tools/agent.go: optionalagentproperty (per task and single-task form); file body wins as system prompt, frontmatter model beats the per-task model (inherit falls through toresolveModel),typeis derived from the resolved allowlist (ReadOnly iff every tool is inagentdomain.ReadOnlyTools, else ReadWrite; with no allowlist the subagent keeps the parent's tools and runs ReadWrite); unknown agent names fail with the available agents listed; the tool description appends anAvailable agents:list only when agents are loaded, keeping definitions stable for the prompt cacheinternal/agent/tools/registry.go: loads the Markdown agents once per session at registry construction, validating tool names against the tools actually registered in this sessioninternal/agent/llm_tool_service.go: readsINFER_SUBAGENT_TOOLSand gatesisToolEnabledso a disallowed tool is neither advertised to the model nor executable by name; the allowlist reaches the child through bothsubagentExtraEnv(headless) andbuildChatPaneCommand(tmux)internal/presentation: oneAgentsViewfor/agentsand/a2a- typed rows withlocal(Markdown preset, in-process) anda2a(remote Agent2Agent) chips, composing theAgentReadinessandSubagentCatalogread ports at the presentation boundary;/a2astays as a pre-filtered alias andAgentStatusUpdateEventkeeps refreshing the a2a rows (8f9285d, review follow-up, net -278 lines)LLMToolServiceallowlist gate, and the mergedAgentsView(merged rows, /a2a scope, live updates)docs/subagents.md(format, locations, precedence, Claude Code / Gemini CLI compatibility notes) anddocs/directory-structure.mdlisting.infer/agents/and~/.infer/agents/Notes
tools.agent.max_depth) still applies; a named agent that listsAgentcannot recurse past the limit.tools:list are unknown at load time and dropped with a warning in v1 (per-agentmcpServersand wildcards are out of scope).