Repository navigation
feat: split the system prompt into a stable part and a per-turn block - #114
Merged
Merged
Conversation
Codex reads developer_instructions only when it creates a thread, so every later turn of a Codex conversation kept the first turn's speaker line, time, speaker-change notice and per-turn capability status. Claude got a fresh system prompt every turn, but a per-turn random tag and a minute-precise time made the system prompt differ on every turn, so the conversation history never came from the prompt cache. The system prompt now depends only on the employee's configuration, platform, chat type and backend. Who is speaking, a speaker change naming both people, and per-turn status (personal Feishu/WeCom authorization, saved and one-time credential names, business systems without a token this turn, collaboration and continuation phases) go into a [SYS_TURN:<tag>] block in front of the user's message. The identity tag is fixed per conversation, derived from the relay session id with the master key; tagged identity lines are stripped from message text. The current-time section is replaced by a rule to run `TZ=Asia/Singapore date`. Business system listings drop catalog counts so a catalog fetch does not change the prompt. Conversations are never restarted to apply a changed prompt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-8a95ad # Conflicts: # CHANGELOG.md # coreman/core/auth/system_access.py # tests/api/test_systems_catalog.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
-c developer_instructions=传整份提示,但 Codex 只在新建 thread 时读取它,exec resume时忽略。多轮会话的 rollout 里只有第一轮的身份标签,「当前时间」也停在第一轮。于是发言者、换人提醒、时间、本人飞书授权状态、一次性密钥、协作/同事答复/定时续接的阶段说明,在续聊轮次都到不了模型。改动
--append-system-prompt/ Codexdeveloper_instructions)只取决于机器人配置、平台、聊天类型、后端,同一会话逐字不变。发言者、换人提醒和各能力的本轮状态写进用户消息开头由平台生成的[SYS_TURN:<tag>]块;规则仍在 system prompt。Cipher.mac),无需迁移;用户消息里带标签的[SYS_USER:…]、[SYS_TURN:…]行一律过滤。TZ=Asia/Singapore date。设计见
docs/superpowers/specs/2026-10-07-turn-context-prompt.md。测试
uv run pytest -n 4:2989 passeduv run ruff check .、uv run mypy coreman通过🤖 Generated with Claude Code