v4: system prompt 87 lines, mode emoji in topic title, bot/ split begins#212
Open
MagMueller wants to merge 1 commit into
Open
v4: system prompt 87 lines, mode emoji in topic title, bot/ split begins#212MagMueller wants to merge 1 commit into
MagMueller wants to merge 1 commit into
Conversation
…ot/markdown.py system-prompt.md: 170 -> 87 lines. Dropped SSH section, shrank Scheduling + Self-update + Browser, folded "If running as Codex" into "How you work". The top "How the system works" 5 bullets carry the model; everything else is convention/detail. Mode visibility: every /goal topic gets a mode emoji prefix in its title — 🛟 for copilot, 🚀 for autopilot. User sees the mode in the topic list at a glance. /autopilot and /copilot rename the topic via editForumTopic so the prefix swaps. /goal ack mentions the indicator explicitly. _decorate_topic_title is idempotent (strips existing prefix before re-decorating). Codex approval check: codex is launched with `-a never -s danger-full-access` (telegram_bot.py:4560). Codex's native approval gates are off; copilot vs autopilot is enforced purely at the prompt level. Both CLIs behave the same. Split start: extracted agent/bot/markdown.py (243 LOC) — MDV2 escaping, expandable blockquote rendering, streaming view, message chunking. Pure helpers, no Bot state. Re-imported as module-level names in telegram_bot.py so internal callers keep working unchanged. Pattern is established for follow-up splits (streaming, goal helpers, miniapp URL helpers, providers). Tests: 33 pass. 4 new tests for _decorate_topic_title. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
MagMueller
added a commit
that referenced
this pull request
May 15, 2026
…omposio for codex Lands 16 stacked PRs reviewed by multiple sub-agents: - v1 (#209) /goal as primitive, per-topic autopilot vs copilot - v2 (#210) drop agency-mode gate, fold doctrine into CLAUDE.md, delete old Mini App UI - v3 (#211) CLAUDE.md → system-prompt.md (source of truth), agent identity = "agency" - v4 (#212) trim system prompt to 87 lines, mode emoji in topic title, extract bot/markdown.py - v5 (#213) heartbeat-by-default plumbing (later removed), copilot voice fix, autopilot security note - v6 (#214) steering semantics, new-topic spawning, 2-option cards, source-aware images - v7 (#215) /goal IS autopilot framing, drop topic emoji prefix, silence allowed, codex goals=true, `schedule` alias - v8 (#216) drop --spawn-topic, --importance, trim agency-report docstring - v9 (#217) new-topic helper — spawn fresh lane synchronously, queue heartbeat - v10 (#218) self-schedule only when waiting on something concrete; drop auto-heartbeats - v11 (#219) /goal is a verbatim CLI passthrough; bot is a dumb pipe - v12 (#220) drop 30-min timeout, kill lingering heartbeat, prompt-injection defenses, seed goals.md - v13 (#221) /goal stays copilot by default; autopilot only on explicit user opt-in - v14 (#222) doctrine fixes from final multi-agent review - v15 (#223) tighten autopilot triggers — drop the loose phrases - v16 (#224) register composio MCP for codex too; simplify autopilot trigger paragraph Tests: 22 pass. Follow-ups (tracked, not in this merge): - P0: install bootstrap.sh as /usr/local/sbin root:root (closes the trivial bux→root) - P1: stuck-lane watchdog (no-stdout-for-30-min SIGTERM) - P1: /invite is a dead command (remove from BotFather menu) - P1: composio tool names wrong-case in system prompt - P1: help text + COMMANDS still reference dropped autopilot trigger phrases - P1: BUX_BOX_TOKEN provenance for OSS self-host installs - P2: button-tap dispatches bypass _enqueue (lane race on rapid taps) - P2: persisted per-topic autopilot flag in state (instead of LLM phrase detection) - P2: agency_db ghost columns (importance, spawn_topic) - P2: mini app teardown decision (1700 LOC for an unreferenced surface) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Stacked on #211 (simplify-v3 → system-prompt.md rename).
Three changes, one PR
1. System prompt trimmed 170 → 87 lines
You said it was still too long. Dropped SSH (rarely used), shrank Scheduling + Self-update + Browser, folded "If running as Codex" into "How you work". The new "How the system works" 5 bullets at the top carry the whole model; everything else is convention/detail. The agent has the full system in ~one screen.
2. Mode visibility — emoji prefix in topic title
You called out that the user doesn't know which mode they're in. Now every
/goaltopic title gets a mode emoji prefix:User sees the mode in the topic list at a glance.
/autopilotand/copilotrename the topic viaeditForumTopicso the prefix swaps. The/goalack explicitly tells the user the mode and how to switch.3. Codex approval check — there is no bug
You asked whether codex still gates approvals in /goal mode. Answer: no. Codex is launched with
-a never -s danger-full-access(telegram_bot.py:4560). Codex's native approval gates are OFF. Copilot vs autopilot is enforced purely at the prompt level — the LLM reads the mode in the system prompt + goal prompt and follows it. Both CLIs behave the same.In copilot mode the LLM drafts, calls
agency-reportto post a card with buttons, and waits for the user's tap. The tap IS the approval. In autopilot mode it acts directly. Neither flow involves codex's-amechanism.4. Bot split begins
agent/bot/folder created. First module extracted:bot/markdown.py(243 LOC) — MDV2 escaping, expandable blockquote rendering, streaming view, message chunking. Pure helpers, no Bot state. Re-imported as module-level names intelegram_bot.pyso internal callers stay unchanged.This sets the pattern. Follow-up PRs will move:
bot/streaming.py—StreamingMessage+ token humanizingbot/goal.py— goal helpers (record, mode, agency prompt, topic decoration)bot/miniapp_url.py— Mini App URL/tunnel resolutionbot/providers.py—_GhProvider,_CodexProviderbot/terminal.py—ShellSessionBot class + lane state stay in
telegram_bot.pyfor now.Tests
33 pass (4 new for
_decorate_topic_titleidempotency).Test plan
pytest33 cases pass/goal Xin a forum → verify 🛟 X title./autopilot→ topic renames to 🚀 X.editForumTopicpermission (bot must be admin with manage_topics)🤖 Generated with Claude Code
Summary by cubic
Trimmed the system prompt to 87 lines and made goal topics show mode via emoji so users can see copilot/autopilot at a glance. Started splitting bot code by extracting MarkdownV2 and chunking helpers into
agent/bot/markdown.py.New Features
/goalcreates topics with the emoji;/autopilotand/copilotrename viaeditForumTopic. The/goalack states the mode and how to switch.Refactors
agent/system-prompt.mdtrimmed 170 → 87 lines (removed SSH, tightened Scheduling/Browser/Self-update, folded Codex notes into “How you work”). Copilot vs autopilot is prompt-enforced; Codex approval gates are disabled.agent/bot/markdown.py; re-exported intelegram_bot.pyto avoid call-site changes._decorate_topic_titleidempotency; 33 tests pass.Written for commit f34d4bc. Summary will update on new commits. Review in cubic