feat(agent-core-v2): add hostIdentity domain for host-overridable system prompt identity#2144
feat(agent-core-v2): add hostIdentity domain for host-overridable system prompt identity#2144sailist wants to merge 2 commits into
Conversation
…tem prompt identity
- add app-scope hostIdentity domain (L3) with productName / replyStyleGuide
overrides and hostIdentitySeed for composition roots
- render ${product_name} and ${reply_style_guide} in the base system prompt,
falling back to CLI defaults when the host provides no override
- seed the variables from AgentProfileService via IHostIdentity
- expose hostIdentity on kap-server's ServerStartOptions
🦋 Changeset detectedLatest commit: b62750c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
a5a3900 to
b62750c
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a5a3900ce7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // through `opts.seeds`, which override this entry (last seed wins). | ||
| ...hostRequestHeadersSeed({ 'User-Agent': `kimi-code-cli/${hostVersion}` }), | ||
| ...skillCatalogRuntimeOptionsSeed(opts.skillDirs), | ||
| ...hostIdentitySeed(opts.hostIdentity), |
There was a problem hiding this comment.
Seed web hosts with non-terminal prompt identity
When the bundled kimi web path starts this server it does not pass hostIdentity (checked apps/kimi-code/src/cli/sub/web/run.ts:269-288), so this seed is empty and systemPromptVars falls back to the CLI terminal wording. For browser-hosted sessions the model still receives terminal-specific reply guidance, defeating the new host override for an existing non-terminal host; pass a web/GUI identity from that start path or choose a non-terminal default when serving web assets.
AGENTS.md reference: AGENTS.md:L18-L18
Useful? React with 👍 / 👎.
Related Issue
No linked issue — the problem is explained below.
Problem
The base system-prompt template hardcodes the product name ("Kimi Code CLI") and a terminal-oriented reply-style guide (Markdown rendering in a terminal). Products that embed the engine through
kap-server— for example a desktop app — host agents whose replies are not rendered in a terminal, but they have no way to adjust the product identity or the reply-style guidance in the system prompt.What changed
hostIdentitydomain (L3) inagent-core-v2that holds host-injectedproductName/replyStyleGuideoverrides, plus ahostIdentitySeedfor composition roots; the registered default carries no overrides.system.mdtemplate now renders${product_name}and${reply_style_guide}slots, falling back to the CLI defaults (DEFAULT_PRODUCT_NAME/DEFAULT_REPLY_STYLE_GUIDE) when the host provides no override.AgentProfileServiceseeds these template variables fromIHostIdentitywhen building the system-prompt context.kap-server'sServerStartOptionsgained ahostIdentityoption, applied at bootstrap to every agent the server hosts.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.