Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

fix(host): keep bot instructions general and short

leepokai69e798cc4bec
diff --git a/docs/features/context-and-memory.md b/docs/features/context-and-memory.md
index 16be7eaa..cf96e1fd 100644
--- a/docs/features/context-and-memory.md
+++ b/docs/features/context-and-memory.md
@@ -17,8 +17,9 @@ its own context and compacts it itself.
## Instruction snapshot (`host/src/chat/context.rs`)
-- The bot's instructions are rendered once: profile (name, description, skills, phone-friendly rule) plus the
- memory section. They're stored as a snapshot in `kv` under `context.<bot>`, keyed by **session + compaction
+- The bot's instructions are rendered once, in English and kept general: profile (name, description), how to
+ message the user, other conversations, workspace, skills, plus the memory section. How to use each tool
+ lives with the tool (MCP server instructions, tool descriptions), not here. They're stored as a snapshot in `kv` under `context.<bot>`, keyed by **session + compaction
epoch**, and don't change until one of those changes. This keeps the prompt byte-identical so the prompt
cache stays warm.
- **Claude** (`agentCapabilities._meta.claudeCode` present) receives the snapshot as a real system prompt:
diff --git a/host/src/chat/context.rs b/host/src/chat/context.rs
index 0541e177..7a459d20 100644
--- a/host/src/chat/context.rs
+++ b/host/src/chat/context.rs
@@ -126,16 +126,24 @@ pub fn render(store: &Store, cfg: &BotConfig) -> String {
if !cfg.description.trim().is_empty() {
lines.push(format!("Description: {}", cfg.description.trim()));
}
- lines.push("You are a persistent agent the user delegates work to from their phone through Codync.".to_owned());
- lines.push(crate::chat::outbox::INSTRUCTIONS.to_owned());
- lines.push(format!("Your default execution directory is {}. {} Use this space for your own task files and outputs. When a task concerns another project or folder, use explicit paths or change directory for that command; do not change your bot configuration just to work elsewhere. This directory is not a sandbox or a grant of access: follow the user's instructions and the agent's permissions. Do not assume other bots' files belong to you.", cfg.cwd, if crate::agent::workspace::is_managed(cfg) { "Codync allocated this persistent workspace exclusively for you." } else { "The user selected this project folder." }));
- lines.push(crate::chat::team::INSTRUCTIONS.to_owned());
- lines.push(crate::routines::INSTRUCTIONS.to_owned());
+ // General on purpose: how to talk and where to work. Each tool's own instructions (MCP
+ // servers, tool descriptions) explain the tool, so they aren't repeated here.
+ lines.push(String::new());
lines.push(
- "Your history is shared across your chats: a message that starts with [Group chat: ...] is your turn in a group chat, where the user and the other bots see only your final reply. Everything else here is your private chat with the user: don't @-mention anyone in it, and don't assume a group sees it."
+ "You are a persistent agent the user delegates work to through Codync, from their phone or computer."
.to_owned(),
);
+ lines.push(String::new());
+ lines.push(format!("Messages: {}", crate::chat::outbox::INSTRUCTIONS));
+ lines.push(String::new());
+ lines.push(
+ "Other conversations: your history is shared across them. A group chat turn starts with [Group chat: ...]; a request from another bot or a routine run says so in its first line. There send_message isn't available: your final reply is what gets delivered, so write it for its reader. Only @-mention in group chats, and don't assume a group sees your private chat."
+ .to_owned(),
+ );
+ lines.push(String::new());
+ lines.push(format!("Workspace: your default working directory is {}. {} Keep your own files and outputs there. For another project, use explicit paths or change directory for that command; don't change your bot configuration to work elsewhere. This directory is not a sandbox or a grant of access: follow the user's instructions and your permissions, and don't assume other bots' files are yours.", cfg.cwd, if crate::agent::workspace::is_managed(cfg) { "Codync allocated it for you alone." } else { "The user chose this project folder." }));
if let Some(skills) = crate::market::skills_brief(store, &cfg.skills) {
+ lines.push(String::new());
lines.push(skills);
}
let mut out = lines.join("\n");
diff --git a/host/src/chat/memory.rs b/host/src/chat/memory.rs
index e3cd0069..ca4afdb4 100644
--- a/host/src/chat/memory.rs
+++ b/host/src/chat/memory.rs
@@ -338,7 +338,7 @@ pub fn render(recall: &Recall, location: &Path) -> (String, bool) {
"Your memory lives in a folder at {}: {PROFILE_FILE} holds who the user is (kept in mind every turn) and {LOG_DIR}/ holds dated history.",
location.display()
),
- "Read or grep those files when you need older facts that are not listed here, and use the search_history tool to find what was actually said in past chats. Memory is updated automatically in the background shortly after each conversation: when the user asks you to remember or forget something, just confirm it in your reply and it will be recorded.".to_owned(),
+ "Read or grep those files when you need older facts that are not listed here, and use the search_history tool to find what was actually said in past chats. Memory is updated automatically in the background shortly after each conversation: when the user asks you to remember or forget something, just confirm it to them and it will be recorded.".to_owned(),
];
if !recall.profile.is_empty() {
lines.push("About the user:".into());
@@ -868,7 +868,7 @@ const SEARCH_TERMS: usize = 8;
const SEARCH_TEXT_CHARS: usize = 1_500;
pub const INSTRUCTIONS: &str = "Use search_history to find what was actually said in your past chats with the user \
-(their messages and your final replies, including threads), beyond what your memory notes kept. \
+(their messages and yours, including threads), beyond what your memory notes kept. \
Search for distinctive words; every word must appear. Results are newest first.";
pub fn tools() -> Value {
diff --git a/host/src/chat/outbox.rs b/host/src/chat/outbox.rs
index f5dfedf0..12728c8c 100644
--- a/host/src/chat/outbox.rs
+++ b/host/src/chat/outbox.rs
@@ -10,11 +10,11 @@ use serde_json::{Value, json};
use std::sync::Arc;
use std::time::Duration;
+/// How to talk to the user: part of every bot's instructions (`context`), and the `chat` server's.
pub const INSTRUCTIONS: &str = "In your chat with the user and its threads, the user sees only what you send with send_message; \
text you write as your reply never reaches them. Send a message whenever you have something worth telling them: \
-short, plain and phone-friendly, a sentence or a few, each message one thought. Lead with the result, then what needs the user. \
-Don't send just to acknowledge, to say you started or are still working, or to repeat yourself. \
-In a group chat, a teammate's request or a routine, send_message isn't available: write your answer as your reply.";
+short and plain, one thought per message, in the user's language. Lead with the result, then what needs the user. \
+Don't send just to acknowledge, to say you started or are still working, or to repeat yourself.";
/// Longest message accepted, in bytes.
const MAX_MESSAGE_BYTES: usize = 32 * 1024;
diff --git a/host/src/routines/mod.rs b/host/src/routines/mod.rs
index f3524217..6df7e6bf 100644
--- a/host/src/routines/mod.rs
+++ b/host/src/routines/mod.rs
@@ -478,7 +478,7 @@ pub fn call(hub: &Arc<Hub>, bot: &str, name: &str, args: &Value) -> Result<Value
}
}
-pub const INSTRUCTIONS: &str = "Create and manage persistent Codync routines when the user asks for scheduled or event-driven work. Use the built-in routines tools (save_routine, list_routines, set_routine_enabled, delete_routine, run_routine, routine_webhook), not operating-system cron or an improvised background process. For recurring clock schedules, always use a five-field cron trigger with an explicit IANA timezone, including minute/hour frequencies; do not create interval triggers for those requests. Preserve existing intervals when editing unrelated fields. Cron steps reset within their field: */7 minutes is not an exact seven-minute duration across hours. Use once for a single dated execution; never approximate a one-time task with an annually repeating cron expression. Before saving, resolve the task, trigger and intended timezone for calendar/one-time schedules from the conversation; ask only for missing or ambiguous details. If the request is already clear, create it without another confirmation. Check that tools, connector sign-ins and files needed by the task are available; describe any missing setup rather than promising the task will work. Use list_routines before creating or editing to avoid duplicates; preserve unrelated triggers, enabled state and instructions. Save returns the actual routine ID, trigger descriptions and nextRunAt: use these to report what was really saved, including timezone, next occurrence and enabled/paused state. Do not claim success if the tool failed. run_routine executes the real task immediately, including its side effects; use it when the user requested a test or immediate execution, not merely to validate a schedule. A routine runs locally in its own conversation; the host must be running and awake, results appear in the main chat, and (pass) stays silent. Webhooks use a per-routine key: senders POST to the returned public url (through the Codync cloud; null when the cloud is off, then only localUrl on this computer works) with Authorization: Bearer <key>, or, for GitHub, set the webhook's content type to application/json and its secret to the key (deliveries are verified by their X-Hub-Signature-256). GitHub deliveries become events {source:github, event:<event>.<action>, repo, sender, text, url, payload} that event triggers can filter. Deliveries made while the computer is offline wait up to 72 hours in the cloud. The cloud sees delivery contents (they are not end-to-end encrypted). routine_webhook with rotate:true replaces the key; the old one stops working at once. This does not register a provider subscription: set that up with the user. Never claim a third-party integration is connected until a real delivery has been verified; report a saved webhook as awaiting connection when that setup is missing. Keep secrets out of routine instructions and ordinary status summaries.";
+pub const INSTRUCTIONS: &str = "Create and manage persistent Codync routines when the user asks for scheduled or event-driven work. Use the built-in routines tools (save_routine, list_routines, set_routine_enabled, delete_routine, run_routine, routine_webhook), not operating-system cron or an improvised background process. For recurring clock schedules, always use a five-field cron trigger with an explicit IANA timezone, including minute/hour frequencies; do not create interval triggers for those requests. Preserve existing intervals when editing unrelated fields. Cron steps reset within their field: */7 minutes is not an exact seven-minute duration across hours. Use once for a single dated execution; never approximate a one-time task with an annually repeating cron expression. Before saving, resolve the task, trigger and intended timezone for calendar/one-time schedules from the conversation; ask only for missing or ambiguous details. If the request is already clear, create it without another confirmation. Check that tools, connector sign-ins and files needed by the task are available; describe any missing setup rather than promising the task will work. Use list_routines before creating or editing to avoid duplicates; preserve unrelated triggers, enabled state and instructions. Save returns the actual routine ID, trigger descriptions and nextRunAt: use these to report what was really saved, including timezone, next occurrence and enabled/paused state. Do not claim success if the tool failed. run_routine executes the real task immediately, including its side effects; use it when the user requested a test or immediate execution, not merely to validate a schedule. A routine runs locally in its own conversation; the host must be running and awake, results appear in the main chat, and (pass) stays silent. Webhook triggers: routine_webhook explains how senders deliver; never claim a third-party integration is connected until a real delivery has been verified. Keep secrets out of routine instructions and ordinary status summaries.";
pub fn tools() -> Value {
let id = json!({"type":"string"});
@@ -492,7 +492,7 @@ pub fn tools() -> Value {
("run_routine", "Start a test run, including for a paused routine."),
(
"routine_webhook",
- "Get the routine's public webhook URL (null when the Codync cloud is off), its local URL and secret key. rotate:true replaces the key.",
+ "Get the routine's webhook: its public url (through the Codync cloud; null when the cloud is off, then only localUrl on this computer works), localUrl and per-routine key. Senders POST with Authorization: Bearer <key>; for GitHub, set the webhook's content type to application/json and its secret to the key (deliveries are verified by X-Hub-Signature-256) and they become events {source:github, event:<event>.<action>, repo, sender, text, url, payload} that event triggers can filter. Deliveries made while the computer is offline wait up to 72 hours in the cloud, which sees their contents (not end-to-end encrypted). rotate:true replaces the key; the old one stops working at once. This doesn't register a provider subscription: set that up with the user, and report the webhook as awaiting connection until then.",
),
] {
let required = if name == "set_routine_enabled" { vec!["id", "enabled"] } else { vec!["id"] };
diff --git a/host/src/voice.rs b/host/src/voice.rs
index c547b2da..aa93c1cc 100644
--- a/host/src/voice.rs
+++ b/host/src/voice.rs
@@ -14,7 +14,7 @@ use std::time::Duration;
const SLOT: &str = "voice";
const TIMEOUT: Duration = Duration::from_secs(15);
/// Speech to text: keep the speaker's language and script, and coding terms as written.
-const TRANSCRIBE_HINT: &str = "Keep the speaker's language and script (Traditional Chinese stays Traditional Chinese, 繁體中文). Keep code, file and product names as written.";
+const TRANSCRIBE_HINT: &str = "Keep the speaker's language and script. Keep code, file and product names as written.";
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum Provider {