Skip to content

feat(sessions): open a daemon thread as a named Markdown agent - #1751

Merged
edenreich merged 8 commits into
mainfrom
feat/thread-named-agent
Nov 7, 2026
Merged

edenreich merged 8 commits into
mainfrom
feat/thread-named-agent

Conversation

@edenreich

@edenreich edenreich commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #1750

Summary

A client of infer daemon can open a thread as a named Markdown agent by sending agent: <name> on new_session or resume_conversation. The daemon the thread is opened on resolves the agent from the frame's project_dir and the home dir with the existing loader. Agents are looked up in the layout skills and custom tools already use: .infer/agents, .agents/agents, ~/.infer/agents, then ~/.agents/agents. The thread then runs with:

  • the agent's body as its system prompt
  • its front-matter model, or the thread's selected model when the agent names none
  • its tools / disallowedTools, which restrict the worker the way a named subagent's do

The resolved options travel as thread options, so a workspace relay and a teleport keep them without needing the agent files. The desktop side is inference-gateway/desktop#447.

Changes

  • ThreadOptions gains agent, tools and disallowed_tools. Portable() carries the resolved tool lists and never the name.
  • The registry resolves agent through a new ResolveAgent port when it creates a thread. cmd/daemon wires it to tools.ResolveThreadAgent. An unknown agent fails the open with a RUN_ERROR naming the available agents.
  • A front-matter model wins over the thread's model. An empty, inherit or bare-alias model keeps the thread's model. custom_instructions still append.
  • The tool lists reach the worker as INFER_SUBAGENT_TOOLS and the new INFER_DISALLOWED_TOOLS, without the subagent parent and depth env. The worker's tool service applies them against its real registry, so project custom tools and a remote workspace's own tool set are handled where they exist.
  • The worker's tool service warns once, on its first tool listing, for each allowlisted tool its registry does not have, so a typo in an agent's tools leaves a log line.
  • A workspace relay now opens the session with the thread's portable options instead of forwarding the client's raw open frame, so the peer never sees an agent name only this daemon can resolve.
  • The unknown-agent lookup is shared with the Agent tool's applyNamedAgent.
  • Markdown agents are now also found in the open-standard .agents/agents (project) and ~/.agents/agents (user), after their .infer siblings. This is the same layout as skills and custom tools, so a subagent and a thread see the same agents. /agents labels the ~/.agents ones as user.
  • Docs: internal/sessions/README.md, docs/browser-extension-protocol.md, docs/subagents.md, docs/agents-configuration.md, docs/directory-structure.md.

Notes for review

  • Relay behaviour change: a relayed open no longer forwards options Portable() leaves out (sandbox_directories, workspace*, subagent). That matches what Portable documents, but it is a change for every relayed thread, not only agent threads.
  • Model: the agent's model only sets the model the thread opens with. A later select_model switches it like any other thread. The desktop shows the picker read-only in an agent chat and sends no select_model there ([FEATURE] Run an agent chat as its Markdown agent through the CLI desktop#447).
  • Mode: the thread's mode is not derived from the tool allowlist (unlike a subagent's), so the client's mode / set_mode keep control.
  • MCP tools: an agent with only disallowedTools keeps the worker's MCP tools, since the worker matches against its live registry.

Verification

  • go test ./internal/... ./cmd/... passes. New table-driven tests cover ThreadOptions JSON and Portable, workerArgs/workerEnv, registry resolution (none, known, unknown → RUN_ERROR, resolved Options()), ResolveThreadAgent (model wins, inherit, alias, unknown, tools: [], project over user), the deny-list gates, the unknown-tool warning, and the relayed open.
  • task precommit:run passes (golangci-lint 0 issues, markdownlint clean).
  • task test:e2e passes, including the new tests/e2e/named_agent_test.go. It drives a real infer daemon over the binding against a recording mock gateway and asserts on what the worker sends:
    • the requests go to the agent's front-matter model (anthropic / claude-sonnet-4-5, not the thread's openai/gpt-4o)
    • the system prompt starts with the agent's body
    • only the agent's tools (Read) are offered, and a Write call the model makes anyway never runs
    • an inherit agent, loaded from ~/.agents/agents, keeps the thread's model and still switches
    • an unknown agent is refused
  • With the resolver unwired in cmd/daemon, all three e2e tests fail, so they test the feature and not the mock.

Docs ticket

inference-gateway/docs#1114

A Markdown agent's disallowedTools reach a worker as INFER_DISALLOWED_TOOLS.
The tool service hides and refuses those tools whatever the allowlist says, so
a lone disallowedTools list resolves against the worker's real registry.
A pinned worker answers select_model without switching, and the models reply
still reports the pinned model as current. The daemon sets it for a thread
whose Markdown agent names a model.
new_session and resume_conversation take an agent thread option. The registry
resolves it through a ResolveAgent port when it creates the thread, which the
daemon wires to tools.ResolveThreadAgent over the frame's project_dir and
~/.infer/agents with the existing loader. The agent's body becomes the system
prompt, a frontmatter model replaces the thread's and is pinned, and its tools
and disallowedTools restrict the worker without the subagent parent and depth
env. An inherit or alias model keeps the thread's model. An unknown agent
fails the open with a RUN_ERROR naming the available agents.

The thread keeps the resolved options, and Portable carries them, so a
relaunch or a teleport never needs the agent files again.
A relay forwarded a client's own resume_conversation or new_session to the
workspace, so the peer saw the raw agent name and resolved it against files it
may not have. The relay now sends its own open frame of the client's type,
carrying the thread's portable options, which hold what the agent resolved to.
@edenreich
edenreich marked this pull request as ready for review November 7, 2026 15:28
@edenreich
edenreich requested a review from a team as a code owner November 7, 2026 15:28
@edenreich

Copy link
Copy Markdown
Contributor Author

@infer /model ollama_cloud/glm-5.3 can you review this PR? is it ready for merge? use /ponytail:ponytail /ponytail:ponytail-review /go /go-concurrency /clean-architecture /domain-driven-design /clean-code /cobra-viper

@inference-gateway-maintainer

inference-gateway-maintainer Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Model: ollama_cloud/glm-5.3 · Action: v0.59.5 · CLI: v0.246.0 · Gateway: v0.63.1 · View Job

Todos

  • Read the full diff and commit history
  • Review core path: ThreadOptions, registry resolution, mdagent loader
  • Review worker env, tool allowlist application, pin-model behavior
  • Review relay/teleport portable options and concurrency concerns
  • Check tests (e2e, scenarios) and docs coverage
  • Run changed packages' unit tests, e2e suite, and golangci-lint (all green)
  • File the pending [DOCS] ticket ([DOCS] Daemon threads opened as a named Markdown agent docs#1114)
  • Write review verdict: is it ready for merge?

Pull Request

#1751

✅ Infer Result: Success

All work is complete - the review is done, verification is green, and the pending [DOCS] ticket is now filed. Here is the complete review, which is the final report for this run:

Review of PR #1751 - ready for merge

What this change does: A daemon client can send agent: <name> on new_session / resume_conversation, and the daemon resolves that Markdown agent into the thread's model, system prompt, tool lists and a model pin before the worker launches. The resolved options become plain thread options, so a workspace relay and a teleport carry them without needing the agent files, and the worker enforces the tool lists through its own tool service against its live registry.

This was a review-only run: no code was changed, nothing was committed or pushed.

What I verified in this environment (all green)

  • go test over every changed package: internal/sessions/..., internal/tools/..., internal/agent/teleport/..., internal/presentation/headless/..., internal/scheduler/..., cmd/daemon/..., cmd/headless/... - pass
  • go test ./cmd/... (cmd/agents also consumes the changed loader) - pass
  • go test -tags e2e ./tests/e2e/ -run TestDaemon - the three new named-agent tests pass: the front-matter model wins before and after select_model, the agent body is the system prompt, only the agent's tools are offered, a Write call the model makes anyway never runs, an ~/.agents inherit agent keeps the thread's model, and an unknown agent is refused with RUN_ERROR
  • golangci-lint run over the same packages - clean

Findings

Must fix: none.

Should fix

  1. A thread agent whose tool list matches nothing in the worker leaves it with zero tools, silently (internal/tools/mdagent.go:187, internal/tools/service.go:30)
    • What this is: ResolveThreadAgent loads the agent with a nil knownTools, so every name in the front-matter tools travels unresolved and the worker applies the allowlist against its live registry.
    • Problem: the subagent path drops and warns on unknown names (internal/tools/mdagent.go:245), but the thread path has no equivalent. One typo (tools: [Read, Grepp]), or a custom tool that exists only in the authoring project, makes the allowlist match nothing, so the worker advertises no tools at all. The model then does nothing and no log line says why.
    • Fix: in the worker's NewService, log a warning for each INFER_SUBAGENT_TOOLS entry that matches no registered tool. About six lines, no behavior change.
    • If we skip it: misconfigured thread agents fail with no breadcrumb. Follow-up-sized, not a merge blocker.

Nice to have

  1. --pin-model without --serve is a silent no-op (cmd/headless/headless.go)
    • What this is: the flag is read for every headless invocation but only consumed in the serve branch (internal/presentation/headless/headless.go).
    • Problem: infer headless --pin-model --keep-alive "task" accepts the flag and ignores it, since the panel frames that pinning answers only exist in serve mode.
    • Fix: a one-line guard in RunE refusing the combination, or leave it - the help text already scopes the flag to --serve, and only the daemon sets it today.
    • If we skip it: nothing breaks in production.

Verified and agreed (the PR body's own review notes)

  • The relay change is correct. I traced remoteWorker.Send, the first-open path (openUnlessOpenedBy + openAs) and the snapshot suppression: sync.Once still serializes the first open, ownSnapshot only swallows the snapshot for a relay-initiated open (a client that opened still gets its answer), and w.open is read-only after construction, so the value copy in openAs has no race. Dropping sandbox_directories, workspace* and subagent from relayed opens matches what Portable() documents and what the relay's project_dir rewrite already implied - sandbox paths belong to the daemon the thread was opened on. Covered by TestARelayOpensWithTheThreadsResolvedAgentOptions.
  • Denylist enforcement is real, not cosmetic. isToolEnabled (internal/tools/service.go:57) gates both advertisement (ListToolsForMode) and execution (ExecuteTool), and the e2e proves a denied Write never runs. Tool names joined into INFER_SUBAGENT_TOOLS cannot smuggle env entries: exec splits env on the first =, and a comma or newline inside a name stays one bogus allowlist entry that matches nothing.
  • Architecture holds. ResolveAgent is a port declared in sessions/domain (still pure: context and time only), implemented where the loader lives in tools, and wired once at the cmd/daemon composition root - dependency arrows point inward, and the shared findMarkdownAgent deleted the Agent tool's two near-copy helpers. Agent resolution runs under the registry mutex, but that mutex already guards the worker's process spawn in workerLocked, so a few file reads are negligible. Resolution happens once at thread creation, so a second client opening an existing thread with a different agent name is ignored - the first open wins, consistent with how the other thread options already apply at launch.
  • The documented limits match the code: the pin covers only the panel's select_model (a /model shortcut in a message or a config reload can still switch), the mode stays client-controlled, and a disallowedTools-only agent keeps the worker's MCP tools.

Verdict

Ship - ready for merge. No must-fix findings, all checks green in this environment, and the one should-fix is follow-up-sized observability work.

Follow-up completed: the docs ticket

The PR body drafted a docs ticket for inference-gateway/docs but never filed it. It is now filed, with the agent lookup locations corrected to the four the final commit reads: inference-gateway/docs#1114. The PR body's draft section still says "not filed yet" - a maintainer may want to swap that line for the link.

Not checked: the PR's claim that unwiring the resolver fails all three e2e tests (would need a code change in a review run), the full task precommit:run markdownlint pass (I ran golangci-lint over the Go packages and read the docs diffs against the code instead), and the desktop side at inference-gateway/desktop#447.

Not checked: the mutation claim and markdownlint above. The one risk worth acting on: a typo in a thread agent's tools list silently zeroes the worker's toolset (finding 1), so the six-line warning is worth a follow-up before users ship agent files in anger.

Model: ollama_cloud/glm-5.3 · Action: v0.59.5 · CLI: v0.246.0 · Gateway: v0.63.1 · Exit Code: 0 · Duration: 14m 28s

Tokens: 3,509,668 in · 52,191 out · 3,561,859 total (37 requests)

Tool calls: 48 total · 100% success rate

Traces
Session: 1794067208-f958b478

session (headless, success)                                                                       14m20s
├── chat ollama_cloud/glm-5.3                                                                      10.6s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       6.4s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     6.4s
│           ╰── POST [inference-gateway, server]                                                    6.4s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 6.4s
├── execute_tool Skill call_yiyufk44                                                               216µs
├── execute_tool Skill call_2dxwdnyw                                                               136µs
├── execute_tool Skill call_u46f0ydb                                                               189µs
├── chat ollama_cloud/glm-5.3                                                                       2.4s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.4s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     2.4s
│           ╰── POST [inference-gateway, server]                                                    2.4s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 2.4s
├── execute_tool Skill call_380s7u4n                                                               110µs
├── execute_tool Skill call_jvm7lwaj                                                               110µs
├── execute_tool Skill call_evywokvb                                                               110µs
├── execute_tool Skill call_iom88jyq                                                               105µs
├── execute_tool Skill call_xsf92g7o                                                                56µs
├── chat ollama_cloud/glm-5.3                                                                       7.0s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       6.6s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     6.6s
│           ╰── POST [inference-gateway, server]                                                    6.6s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 6.6s
├── execute_tool TodoWrite call_28ekn3mx                                                            74µs
├── chat ollama_cloud/glm-5.3                                                                       2.0s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.0s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     2.0s
│           ╰── POST [inference-gateway, server]                                                    2.0s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 2.0s
├── execute_tool Bash call_u910i8ox                                                                 10ms
├── execute_tool Bash call_726xzbj5                                                                  4ms
├── chat ollama_cloud/glm-5.3                                                                       3.6s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       3.6s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     3.6s
│           ╰── POST [inference-gateway, server]                                                    3.6s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 3.6s
├── execute_tool Bash call_5r29yy35                                                                  7ms
├── chat ollama_cloud/glm-5.3                                                                       2.2s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.0s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     2.0s
│           ╰── POST [inference-gateway, server]                                                    2.0s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 2.0s
├── execute_tool Bash call_vobep5mp                                                                  7ms
├── chat ollama_cloud/glm-5.3                                                                       2.5s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.5s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     2.5s
│           ╰── POST [inference-gateway, server]                                                    2.5s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 2.5s
├── execute_tool Bash call_f170uqow                                                                  8ms
├── chat ollama_cloud/glm-5.3                                                                       6.2s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       6.2s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     6.2s
│           ╰── POST [inference-gateway, server]                                                    6.2s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 6.2s
├── execute_tool TodoWrite call_01hl5goe                                                            64µs
├── chat ollama_cloud/glm-5.3                                                                      1m26s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      1m26s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    1m26s
│           ╰── POST [inference-gateway, server]                                                   1m26s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                1m26s
├── execute_tool Read call_ja3dudq6                                                                563µs
├── chat ollama_cloud/glm-5.3                                                                      21.6s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      21.6s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    21.6s
│           ╰── POST [inference-gateway, server]                                                   21.6s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                21.6s
├── execute_tool Read call_6bcvgovx                                                                567µs
├── chat ollama_cloud/glm-5.3                                                                       2.9s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.9s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     2.9s
│           ╰── POST [inference-gateway, server]                                                    2.9s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 2.9s
├── execute_tool Read call_p31zgg4f                                                                695µs
├── chat ollama_cloud/glm-5.3                                                                      20.3s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      20.2s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    20.2s
│           ╰── POST [inference-gateway, server]                                                   20.2s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                20.2s
├── execute_tool Read call_6dfjx7oy                                                                  1ms
├── chat ollama_cloud/glm-5.3                                                                      17.9s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      17.9s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    17.9s
│           ╰── POST /proxy/{provider}/{path...} [inference-gateway, server]                       17.9s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                17.9s
├── execute_tool Read call_uu1v11ae                                                                511µs
├── execute_tool Read call_mp8s735k                                                                540µs
├── chat ollama_cloud/glm-5.3                                                                       3.4s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       3.4s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     3.4s
│           ╰── POST [inference-gateway, server]                                                    3.4s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 3.4s
├── execute_tool Bash call_d6e3imrb                                                                  6ms
├── chat ollama_cloud/glm-5.3                                                                       7.2s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       7.1s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     7.1s
│           ╰── POST [inference-gateway, server]                                                    7.1s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 7.1s
├── execute_tool Bash call_uesiqu8u                                                                  6ms
├── chat ollama_cloud/glm-5.3                                                                      11.1s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      11.1s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    11.1s
│           ╰── POST [inference-gateway, server]                                                   11.1s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                11.1s
├── execute_tool TodoWrite call_rgylrgzi                                                            77µs
├── chat ollama_cloud/glm-5.3                                                                       2.5s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.5s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     2.4s
│           ╰── POST [inference-gateway, server]                                                    2.4s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 2.4s
├── execute_tool Bash call_j1jlwkwg                                                                  7ms
├── chat ollama_cloud/glm-5.3                                                                       3.3s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       3.2s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     3.2s
│           ╰── POST [inference-gateway, server]                                                    3.2s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 3.2s
├── execute_tool Bash call_ccexmcvy                                                                  8ms
├── execute_tool Grep call_dt2rab0n                                                                 26ms
├── chat ollama_cloud/glm-5.3                                                                       8.5s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       8.5s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     8.5s
│           ╰── POST [inference-gateway, server]                                                    8.5s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 8.5s
├── execute_tool Bash call_t0qi0f8b                                                                  4ms
├── chat ollama_cloud/glm-5.3                                                                       4.6s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       4.5s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     4.4s
│           ╰── POST /proxy/{provider}/{path...} [inference-gateway, server]                        4.4s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 4.4s
├── execute_tool Wait call_4okd7535                                                                1m42s
├── chat ollama_cloud/glm-5.3                                                                      10.1s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      10.0s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    10.0s
│           ╰── POST [inference-gateway, server]                                                   10.0s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 9.9s
├── execute_tool Grep call_wqianfea                                                                  1ms
├── chat ollama_cloud/glm-5.3                                                                       6.3s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       6.2s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     6.2s
│           ╰── POST [inference-gateway, server]                                                    6.2s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 6.2s
├── execute_tool Grep call_5378l7si                                                                  1ms
├── execute_tool Grep call_uqgg40ti                                                                  1ms
├── chat ollama_cloud/glm-5.3                                                                       3.8s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       3.8s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     3.7s
│           ╰── POST [inference-gateway, server]                                                    3.7s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 3.7s
├── execute_tool Bash call_l3twa2cm                                                                  5ms
│   ├── session [infer-action, internal] (headless, success)                                        79ms
│   │   ╰── chat openai/gpt-4o [infer-action, client]                                               11ms
│   ├── session [infer-action, internal] (headless, success)                                        30ms
│   │   ╰── chat openai/gpt-4o [infer-action, client]                                                8ms
│   ├── session [infer-action, internal] (headless, success)                                        33ms
│   │   ╰── chat openai/gpt-4o [infer-action, client]                                               11ms
│   ├── session [infer-action, internal] (headless, success)                                       105ms
│   │   ├── chat openai/gpt-4o [infer-action, client]                                               10ms
│   │   ├── execute_tool Write [infer-action, internal] call_0_0                                     1ms
│   │   ╰── chat openai/gpt-4o [infer-action, client]                                                9ms
│   ├── session [infer-action, internal] (headless, success)                                        33ms
│   │   ╰── chat openai/gpt-4o [infer-action, client]                                               11ms
│   ├── session [infer-action, internal] (headless, success)                                        33ms
│   │   ╰── chat openai/gpt-4o [infer-action, client]                                               10ms
│   ├── session [infer-action, internal] (headless, success)                                        30ms
│   │   ╰── chat anthropic/claude-sonnet-4-5 [infer-action, client]                                  8ms
│   ├── session [infer-action, internal] (headless, success)                                        42ms
│   │   ╰── chat anthropic/claude-sonnet-4-5 [infer-action, client]                                 21ms
│   ├── session [infer-action, internal] (headless, success)                                       121ms
│   │   ├── chat anthropic/claude-sonnet-4-5 [infer-action, client]                                  8ms
│   │   ├── execute_tool Write [infer-action, internal] call_0_0                                   128µs [error: tool_error]
│   │   ╰── chat anthropic/claude-sonnet-4-5 [infer-action, client]                                  8ms
│   ╰── session [infer-action, internal] (headless, success)                                        73ms
│       ╰── chat anthropic/claude-sonnet-4-5 [infer-action, client]                                 13ms
├── chat ollama_cloud/glm-5.3                                                                      51.5s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      51.5s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    51.5s
│           ╰── POST [inference-gateway, server]                                                   51.5s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                51.5s
├── execute_tool Wait call_gp7xlmas                                                                501ms
├── chat ollama_cloud/glm-5.3                                                                      31.6s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      31.6s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    31.5s
│           ╰── POST [inference-gateway, server]                                                   31.5s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                31.5s
├── execute_tool Bash call_xx3srrqk                                                                  4ms
├── execute_tool Bash call_dkx0d2km                                                                293ms
├── chat ollama_cloud/glm-5.3                                                                      26.2s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      26.0s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    25.9s
│           ╰── POST /proxy/{provider}/{path...} [inference-gateway, server]                       25.9s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                25.9s
├── execute_tool TodoWrite call_8071aydo                                                            81µs
├── chat ollama_cloud/glm-5.3                                                                      19.4s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      19.3s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    19.3s
│           ╰── POST [inference-gateway, server]                                                   19.3s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                19.3s
├── execute_tool Wait call_dmw1e6va                                                                501ms
├── chat ollama_cloud/glm-5.3                                                                       1m0s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1m0s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1m0s
│           ╰── POST [inference-gateway, server]                                                    1m0s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1m0s
├── execute_tool Bash call_asuaedu1                                                                  1ms
├── execute_tool Bash call_rc0sj6rg                                                                827ms
├── chat ollama_cloud/glm-5.3                                                                      17.6s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      17.5s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    17.4s
│           ╰── POST [inference-gateway, server]                                                   17.4s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                17.4s
├── execute_tool Wait call_efjzh78e                                                                501ms
├── chat ollama_cloud/glm-5.3                                                                      23.9s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      23.8s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    23.8s
│           ╰── POST [inference-gateway, server]                                                   23.8s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                23.8s
├── chat ollama_cloud/glm-5.3                                                                      1m38s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      1m38s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    1m38s
│           ╰── POST [inference-gateway, server]                                                   1m38s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                1m38s
├── execute_tool Memory call_abraghiv                                                               1.1s
├── chat ollama_cloud/glm-5.3                                                                      20.0s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      19.9s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    19.9s
│           ╰── POST [inference-gateway, server]                                                   19.9s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                19.9s
├── execute_tool TodoWrite call_vvvet2hp                                                            64µs
├── chat ollama_cloud/glm-5.3                                                                      53.4s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      53.4s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    53.4s
│           ╰── POST [inference-gateway, server]                                                   53.4s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                53.4s
├── chat ollama_cloud/glm-5.3                                                                      42.8s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      42.7s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    42.7s
│           ╰── POST [inference-gateway, server]                                                   42.7s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                42.7s
├── execute_tool Write call_b2rte5cz                                                                 1ms
├── chat ollama_cloud/glm-5.3                                                                       5.0s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       5.0s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     5.0s
│           ╰── POST [inference-gateway, server]                                                    5.0s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 5.0s
├── execute_tool Bash call_k3bpt3f6                                                                 1.3s
├── chat ollama_cloud/glm-5.3                                                                      15.2s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      14.7s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    14.7s
│           ╰── POST [inference-gateway, server]                                                   14.7s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                14.7s
├── execute_tool Memory call_kam96yg0                                                              986ms
├── execute_tool TodoWrite call_56njma9r                                                            62µs
╰── chat ollama_cloud/glm-5.3                                                                      35.0s
    ╰── POST /v1/chat/completions [inference-gateway, server]                                      35.0s
        ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    35.0s
            ╰── POST [inference-gateway, server]                                                   35.0s
                ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                35.0s
Stats
Tool Calls

╭───────────┬───────┬───────┬─────────╮
│ Tool      │ Calls │ Fail% │ Avg     │
├───────────┼───────┼───────┼─────────┤
│ Bash      │ 16    │ 0%    │ 158ms   │
│ Skill     │ 8     │ 0%    │ 97µs    │
│ TodoWrite │ 6     │ 0%    │ 66µs    │
│ Read      │ 6     │ 0%    │ 701µs   │
│ Wait      │ 4     │ 0%    │ 25876ms │
│ Grep      │ 4     │ 0%    │ 8ms     │
│ Memory    │ 2     │ 0%    │ 1068ms  │
│ Write     │ 1     │ 0%    │ 1ms     │
╰───────────┴───────┴───────┴─────────╯

Token Usage

╭──────────────────────┬─────────┬─────────┬────────────┬─────────┬──────╮
│ Model                │ Prompt  │ Cached  │ Completion │ Total   │ Cost │
├──────────────────────┼─────────┼─────────┼────────────┼─────────┼──────┤
│ ollama_cloud/glm-5.3 │ 3509668 │ 3200768 │ 52191      │ 3561859 │ -    │
╰──────────────────────┴─────────┴─────────┴────────────┴─────────┴──────╯

Sessions

╭───────────┬──────────┬──────────╮
│ Execution │ Mode     │ Sessions │
├───────────┼──────────┼──────────┤
│ headless  │ headless │ 1        │
╰───────────┴──────────┴──────────╯

Triggered by edenreich · Infer Action · OSS

A named agent's front-matter model now only sets the thread's model when
the daemon opens it. Without one the thread keeps the client's selected
model. A later select_model switches the worker like any other thread,
and the desktop does not send one in an agent chat.

This drops headless --pin-model and the pin_model thread option.
A typo in a thread agent's tools left the worker without that tool and
said nothing. The tool service now logs each allowlisted name its
registry does not have, once, on the first listing, after MCP tools
are registered.
@edenreich
edenreich merged commit 7e5533c into main Nov 7, 2026
1 check passed
@edenreich
edenreich deleted the feat/thread-named-agent branch November 7, 2026 16:49
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.247.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[FEATURE] Open a daemon thread as a named Markdown agent

1 participant