Repository navigation
feat(agents): run an agent chat as its Markdown agent through the CLI - #448
Conversation
|
@infer can you resolve the merge conflict? |
|
Model: Todos
Pull Request✅ Infer Result: SuccessMerge conflict on PR #448 is resolved and pushed; GitHub now reports the PR What conflicted and how it was resolvedMain had moved ahead with three commits while the branch was open: the CLI's next-step-suggestion ghost text (d6f3797), the e2e switch to downloading
One note: the flox manifest now pins Sandbox caveat on the history shape
Verification (all green)
All work is complete and pushed. Final summary of the merge-conflict resolution on PR #448: The conflict: main advanced by three commits (d6f3797 next-step ghost text, 4e55ee1 e2e infer tarball download, 7c561f3 flox infer bump to v0.246.2) while the branch carried the agent-chat changes; nine overlapping files produced real conflicts in The resolution: all of main's hunks were reconciled into the branch's files, keeping the branch's Sandbox caveat: Verification: Model: Tokens: 25,182,508 in · 63,752 out · 25,246,260 total (59 requests) Tool calls: 118 total · 100% success rate TracesStatsTriggered by edenreich · Infer Action · OSS |
The daemon opens agent chats with agent: <name>, so the CLI runs them as the Markdown agent: the front-matter model pins the read-only top-bar picker, the body is the system prompt, its tools restrict the worker, and chats teleported to a remote computer demand a model that computer serves. Agents come from the CLI's four agent dirs instead of an agents_dir setting. Squashed resolution of the merge conflict with main: this commit sits on main and carries the reconciled diff of the branch's three prior commits (4769c08 feat(agents), e29b8f2 fix(e2e), 43ed722 refactor(agents)), archived on archive/agent-chat-before-conflict-resolution. Main's next-step suggestion ghost text (d6f3797), e2e infer tarball download (4e55ee1) and flox infer bump to v0.246.2 (7c561f3) are all included and reconciled with the agent changes.
43ed722 to
d97f131
Compare
|
Follow-up from inference-gateway/cli#1751: the CLI no longer pins a thread agent's model ( One gap that predates that change and is worth fixing here: An Suggested fix: drop the
That is a deletion, and it still meets #447's "no |
send_message skipped select_model for every agent chat, so an agent without a model of its own stayed on the model its thread opened with while the picker showed the new global one. The store already sends agentThreadModel, so selecting it again is enough. An agent with its own model sends that model, which the thread already runs on, and no frame goes out until Edit agent changes it.
|
🎉 This PR is included in version 0.55.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Resolves #447
Summary
An agent chat now runs as its Markdown agent through the CLI. The desktop opens the thread with
agent: <name>(inference-gateway/cli#1751), and the CLI reads the agent file. Its body becomes the system prompt, its front-matter model is the chat's model (else the selected model), and its tools restrict the worker. The desktop no longer sends the agent's body itself. In an agent chat the top-bar model picker shows the agent's model read-only - you change it with Edit agent, which writes the front matter. This replaces the closed #446.Merge order: this needs
inferv0.247.0 or newer, the release that carries inference-gateway/cli#1751. An olderinferignoresagent, and since the desktop no longer sends the agent's body, agent chats would run without it. The flox manifest now pins v0.247.0.Changes
backend/src/thread.rs:ThreadOptions.agent, sent asagenton theresume_conversationopen frame. The open-frame test covers it.backend/src/agent.rs:open_threadandsend_messagetakeagent.send_messagestill selects the model the store sends (agentThreadModel). An agent with its own model therefore sends noselect_modeluntil Edit agent changes that model, and aninheritagent's chat follows the global model..flox/env/manifest.toml:inferpinned to v0.247.0.frontend/store.tsx: agent chats passagenton open and send.threadPromptssends no system prompt for them, while project context and the sibling-agents preamble still go as custom instructions.frontend/lib/agents.ts:agentPinsModel(a provider-prefixed front-matter model fixes it, the CLI's rule).agentThreadModelstays for display and the workspace check.frontend/lib/workspace-model.ts:workspaceModel(model, workspace, fixed). A fixed agent model the workspace cannot serve is a problem instead of a silent swap to the workspace's own model. Used by the send path and by the Move-to-workspace warning.frontend/components/ModelSelect.tsx: in an agent chat the native<select id="model-select">shows the agent's model, disabled, with a hint to use Edit agent.backend/src/markdown_agents.rs: theagents_dirsetting is gone. Agents are read from the same four dirs the CLI resolves them from, first match winning on a name:.infer/agentsand.agents/agentsof the dir an agent chat runs in~/.infer/agentsand~/.agents/agentsThe desktop therefore lists exactly the agents the CLI can open. Editing, renaming, deleting and pictures act in the dir an agent was found in, and a new agent goes to
~/.infer/agents.backend/src/config.rs:agents_dirleavesDesktopConfig, and saving Settings drops a staleagents_dirkey fromconfig.yaml. In Settings the "Agents directory" input is replaced by a note naming the four dirs, and the agent editor shows the folder the agent's file is saved in.frontend/components/AgentEditor.tsx: a stored model the gateway does not list (a bare alias likesonnet, a delisted model) stays visible as its own option instead of reading as "Inherit".e2e:
model_agentseed (an agent whose front matter fixesanthropic/claude-sonnet-4-5)agent-own-modelscenario that only answers on that modeltests/agent-own-model.yaml: the top bar shows the agent's model, and the reply only lands if the CLI ran the chat on itbun test:agentPinsModeland the fixed-model workspace case.Verification
cargo fmt --check,cargo clippy -- -D warnings,cargo test(213 passed),bun test(206 passed),bun run build,cargo test -p desktop-e2e.inferv0.247.0 (task e2e -- tests/<name>.yaml):agent-own-model.yaml5/5agent-chat.yaml12/12inferbuilt from feat(sessions): open a daemon thread as a named Markdown agent cli#1751,agent-computers.yaml8/8 (a teleported agent chat) and the full suite (task e2e, 39 tests) passed as well.Docs ticket
inference-gateway/docs#1115