Skip to content

fix: mount the agent preset when /new creates an agent - #2

Merged
Jesse-njx merged 1 commit into
Jesse-njx:mainfrom
pengxuding:fix/preset-mount
Aug 28, 2026
Merged

Jesse-njx merged 1 commit into
Jesse-njx:mainfrom
pengxuding:fix/preset-mount

Conversation

@pengxuding

Copy link
Copy Markdown
Contributor

ctx.agents.create recorded agentPreset in the session meta but never passed a setup hook, so the preset was never composed: agents published against the empty global layer (no tools, prompt sections, or skill catalog - the harness logs a warning per agent). The model then fakes tool calls as literal <|tool-calls|> text and never receives results.

Mirror the Web host's composeAgent: resolve the configured preset (or the deployment default) up front and call agentPresets.mount() from the factory setup hook. Preset resolution errors now surface to the WeChat peer as a creation failure instead of a silent tool-less agent.

Two regression tests cover the setup hook and the no-roster fallback.

ctx.agents.create recorded agentPreset in the session meta but never
passed a setup hook, so the preset was never composed: agents published
against the empty global layer (no tools, prompt sections, or skill
catalog - the harness logs a warning per agent). The model then fakes
tool calls as literal <|tool-calls|> text and never receives results.

Mirror the Web host's composeAgent: resolve the configured preset (or
the deployment default) up front and call agentPresets.mount() from the
factory setup hook. Preset resolution errors now surface to the WeChat
peer as a creation failure instead of a silent tool-less agent.

Two regression tests cover the setup hook and the no-roster fallback.
@Jesse-njx
Jesse-njx merged commit e5e4955 into Jesse-njx:main Aug 28, 2026
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.

2 participants