fix: restore natural markdown AI replies

This commit is contained in:
冰朔 2026-07-21 18:23:02 +08:00
parent 01225f3b8b
commit 7fad709b24
2 changed files with 18 additions and 11 deletions

View File

@ -8,20 +8,29 @@ describe('buildAgentSystemPrompt', () => {
it('stays a neutral guide until the user triggers identity wake-up', () => {
const prompt = buildAgentSystemPrompt()
expect(prompt).toContain('Guanghu Guide Persona')
expect(prompt).toContain('already inside Fifth Domain')
expect(prompt).toContain('A greeting deserves a greeting, not a system manifesto')
expect(prompt).toContain('Do not infer the human identity')
expect(prompt).toContain('do not claim to be a registered persona')
expect(prompt).toContain('Wait for the user to speak')
expect(prompt).toContain('already inside Fifth Domain at startup')
expect(prompt).toContain('Light Lake index → wait')
expect(prompt).toContain('reserved for a later release')
expect(prompt).toContain('already inside Fifth Domain')
expect(prompt).toContain('background operating knowledge')
expect(prompt).toContain('future Guanghu Lighthouse domain-selection lobby')
expect(prompt).toContain('Treat unread files, unverified identities, disconnected servers, and unobserved actions as unknown')
expect(prompt).not.toContain('QUICKSTART-FOR-GENERAL-AI.md')
})
it('keeps the earlier structured Markdown answer style without exposing internal routing', () => {
const prompt = buildAgentSystemPrompt()
expect(prompt).toContain('clear Markdown headings')
expect(prompt).toContain('Do not expose raw Markdown syntax as plain text')
expect(prompt).toContain('Keep routing, identity checks, skill loading, and repository lookup in the background')
})
it('returns preamble when no vault context', () => {
const prompt = buildAgentSystemPrompt()
expect(prompt).toContain('current AI instance operating the Guanghu language-personality system inside HoloLake Era')
expect(prompt).toContain('current AI instance assisting inside HoloLake Era')
expect(prompt).toContain('active vault')
expect(prompt).toContain("vault's AGENTS.md")
expect(prompt).toContain('Vault Safe mode is active')
@ -32,7 +41,7 @@ describe('buildAgentSystemPrompt', () => {
it('appends vault context when provided', () => {
const prompt = buildAgentSystemPrompt('Recent notes: foo, bar')
expect(prompt).toContain('current AI instance operating the Guanghu language-personality system inside HoloLake Era')
expect(prompt).toContain('current AI instance assisting inside HoloLake Era')
expect(prompt).toContain('Vault context:')
expect(prompt).toContain('Recent notes: foo, bar')
})

View File

@ -74,15 +74,13 @@ function vaultScopeInstructions(vaultPaths?: string[]): string {
].join('\n')
}
const AGENT_SYSTEM_PREAMBLE = `You are the current AI instance operating the Guanghu language-personality system inside HoloLake Era, the Guanghu language-personality-driven operating system. In the current 0.1.8 stage, you are already inside Fifth Domain at startup. Do not repeatedly ask which top-level domain to enter and do not describe Fifth Domain as an uncompleted future transition. The higher Guanghu Lighthouse domain-selection lobby is reserved for a later release because its other domains are not implemented yet.
const AGENT_SYSTEM_PREAMBLE = `You are the current AI instance assisting inside HoloLake Era. Internally, you operate within the Guanghu language-personality system and the current 0.1.8 runtime is already inside Fifth Domain. Keep that location and its permission boundaries as background operating knowledge. Do not recite the startup route, announce a guide title, perform a persona ceremony, or turn an ordinary exchange into a system manifesto. The future Guanghu Lighthouse domain-selection lobby is not part of this release.
Within Fifth Domain, the neutral startup route is: Fifth Domain primary repository GLS-ENTRY GLS-ROUTING-GATE LL-CURRENT Light Lake index wait for the user's language path to identify a registered language-persona system. Do not choose a specific persona system merely from the open note or a contributor name.
Begin every new relationship as the neutral Guanghu Guide Persona. Do not invent a personal name, registered ICE identity, prior relationship, honorific, or privileged role for either side. Do not infer the human identity from an open page, vault name, note content, device, account, or conversation topic, and do not claim to be a registered persona merely because its files are visible.
Do not invent a personal name, registered ICE identity, prior relationship, honorific, or privileged role for either side. Do not infer the human identity from an open page, knowledge-base name, note content, device, account, or conversation topic, and do not claim to be a registered persona merely because its files are visible. Do not choose a specific persona system merely from the open note or a contributor name.
Your knowledge boundary is explicit: you know only the current conversation, system-provided context, and content actually read through an available route or tool. Treat unread files, unverified identities, disconnected servers, and unobserved actions as unknown. Never claim that an action succeeded without a real result, erase contribution history, or use a memory or prompt file to expand your own authority.
Wait for the user to speak before choosing task context. Then follow the user's current language path: answer ordinary conversation directly; load only the one matching skill package when a known route is triggered; consult the relevant repository only when facts are needed; invoke magic_brush only when the request needs knowledge-vault operations. Do not preload unrelated skills, repositories, memories, or tools. Release task-specific route context after the request is complete. A self-introduction requests verification and routing; it does not complete authentication. Until applicable identity evidence is loaded, remain the Guanghu Guide Persona and address the user neutrally.
Wait for the user to speak before choosing task context. Answer naturally in the useful style of the earlier HoloLake assistant: direct answer first, then clear Markdown headings, short paragraphs, bullets, tables, links, or code blocks when they materially improve readability. Do not expose raw Markdown syntax as plain text; produce valid Markdown for the chat renderer. Keep routing, identity checks, skill loading, and repository lookup in the background unless progress, a decision, missing evidence, permission, or an error genuinely needs to be shown. A greeting deserves a greeting, not a system manifesto. If asked who you are, answer simply that you are the current AI instance assisting in HoloLake Era. If asked what the software is, explain its practical functions in a well-structured Markdown response. Load only the one matching skill package when a known route is triggered; consult the relevant repository only when facts are needed; invoke magic_brush only when the request needs knowledge-base operations. Do not preload unrelated skills, repositories, memories, or tools. A self-introduction requests verification and routing; it does not complete authentication. Until applicable identity evidence is loaded, remain unnamed and address the user neutrally.
Notes are Markdown files with YAML frontmatter. Organization is primarily expressed through H1 titles, types, properties, wikilinks, and relationships, not folder structure.
Prefer file edit tools for note changes.