Repository navigation
Description
Summary
A client of infer daemon should be able to open a thread as a named Markdown agent: an agent: <name> thread option on new_session / resume_conversation. The thread then runs as that agent - its front-matter model (fixed for the thread), its body as the system prompt, and its tools / disallowedTools allowlist. It is the same overlay the Agent tool already gives a named subagent (applyNamedAgent).
Today the CLI interprets agent files only for subagents. A client that wants an "agent chat" has to reimplement that interpretation itself. The desktop app does exactly that: its own model rule, the body sent as system_prompt, no tools allowlist. Nothing keeps the model fixed, because any select_model switches it. The desktop side is tracked in inference-gateway/desktop (follow-up issue linked below).
Current state, verified in the code:
internal/tools/mdagent.goloads.infer/agents/*.mdthen~/.infer/agents/*.md(loadMarkdownAgents,resolveMarkdownAgentModel,resolveMarkdownAgentTools).internal/tools/agent.goapplyNamedAgentoverlays the agent onto a subagent's task spec. Only the Agent tool calls it.internal/sessions/domain/sessions.goThreadOptionscarriesmodel,mode,system_prompt,custom_instructions,sandbox_directories,max_turns,subagent,workspace,workspace_dir- noagent.cmd/daemon/daemon.gobuilds the registry onteleports.LaunchWorker, the seam every launch goes through, local or relayed to a workspace.internal/sessions/infrastructure/worker.gomaps the options ontoheadless --serveflags andINFER_env.internal/presentation/headless/panel.gomodelPicker.selectModelswitches the worker's model on anyselect_model.
The agent must resolve on the daemon the thread is opened on, which has the user's agent files and the project dir. A thread placed on a remote workspace runs where those files do not exist, so it has to receive the resolved options.
Acceptance Criteria
-
new_session/resume_conversationaccept anagentthread option. The daemon resolves it against the frame'sproject_dir(.infer/agents, then~/.infer/agents) with the existing loader before the worker launches. The resolved model, system prompt and tool allowlist travel as thread options, so a workspace relay and a teleport (Portable()) keep them. - An unknown agent fails the thread with a
RUN_ERRORnaming the available agents. - The thread runs on the agent's front-matter model. Empty,
inheritor a bare alias falls back to the thread's ownmodel, as for subagents. The body is the system prompt,custom_instructionsstill append, and the tools allowlist restricts the worker's tools like a named subagent's. - When the agent pins a model,
select_modelon that thread leaves it unchanged, and themodelsreply reports the pinned model. - Unit tests cover option parsing and relay, resolution (known, unknown, inherit, tools), and the pinned
select_model.internal/sessions/README.mdanddocs/browser-extension-protocol.mddocument the option.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
edenreich commentedon Nov 7, 2026
Desktop follow-up: inference-gateway/desktop#447
inference-gateway-releaser commentedon Nov 7, 2026
🎉 This issue has been resolved in version 0.247.0 🎉
The release is available on:
Your semantic-release bot 📦🚀