Orkas is an open-source (MIT), local-first AI team for your desktop: a Commander turns your goal into to-dos and coordinates 16 built-in specialist agents plus Claude Code, Codex, OpenCode, OpenClaw and Hermes, with projects, scheduled automations and connectors. Free app for macOS & Windows; built-in models or your own keys.
JavaScript agent-collaborationagent-harnessagent-orchestrationagent-teamagent-workflowai-assistantai-automationai-employeeai-productivityai-teamai-workflowautonomous-agentsclaude-code-guiclaude-coworkdesktop-agentlocal-firstmulti-agentmulti-agent-systemself-evolving-agentstask-automation
Treat schema defaults as 'filled' in agent inputs_schema decision
wyt30d34b61f525
diff --git a/CLAUDE.md b/CLAUDE.mdindex 84f16c91..94ec834c 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -86,6 +86,14 @@ Exception: env-var names with the project prefix (`ORKAS_NODE` / `ORKAS_PC_DIR`)**Cross-prompt sync constraint for shared core rules**: when the same domain concept appears across multiple prompt mds (typical example: `<agent>` container creation appears in both `chat_agent_setup.md` (iterative editing), `chat_agent_setup_cli.md` (CLI-backed agent editing — no `<workflow>`/`<skills>`/`<runtime>` sub-tags), and `chat_commander.md` (one-shot finalization)), pick one authoritative prompt as the source of truth (e.g. `<agent>` truth source = `chat_agent_setup.md`); downstream sites carry only the shared principles (workflow split into "input → action → output" / tool priority / `<interactive>` decision rules / forbidden prose tokens), and **do not** copy field details / schema tables / full translation tables. **Before touching the truth source**, run `grep -E "<agent>|<workflow>|<skills>|<inputs>|<interactive>|<runtime>|<description_zh>|<description_en>|<<<skill-file>>>|agent-input-form|agent-input-submission" src/main/prompts/*.md` to find downstream sites and reconcile; new rules that affect downstream must be propagated. The loader does not do template composition (only `$variable` substitution), so consistency relies on the caller actively syncing + git review catching gaps.+**Adding prompt text**: lean-prompt discipline applies to **every LLM-facing prompt** — `prompts/*.md`, SKILL.md bodies, agent / skill specs, and CLAUDE.md itself. Before adding any new clause, run two checks:++1. **Is each clause necessary?** Cut narrative filler ("…and is what users complain about most"), redundant cross-references to globally-declared rules ("(in the user's UI language — the trailing language directive sets that)"), and double-emphasis ("even one token, even one field"). Keep the rule, the *Why* for counter-intuitive choices, and a concrete example when the rule is structural. **The test:** delete the clause; if the model behaves the same, drop it.++2. **Does it conflict with or duplicate existing content?** Grep the same prompt md and its peers (`chat_*.md` share a domain; `chat_shared_rules.md` is injected into multiple roles — see the cross-prompt sync constraint above). Partial overlap → **merge** into one tighter rule, don't ship a parallel paragraph (parallel rules dilute each other; the model honours neither cleanly). Contradiction → **fix one to match the other**, don't ship both.++**Why:** prompt text sits in the cached prefix and shapes every turn. We shipped "don't paste absolute paths" + "don't enumerate bash scratch" as two parallel paragraphs in `chat_shared_rules.md` and watched the model honour neither until the merge. Merge first, write second.+**Prompt-md cache layout** (KV-cache prefix discipline): every `src/main/prompts/<name>.md` is split into two halves — **static rules first, then a single trailing `## Runtime injection` section that collects every `$variable` substitution** (with the most volatile field at the bottom of that section). Final assembled order = `<role>.md` static body → `chat_shared_rules.md` (when applicable) → `<role>.md` `## Runtime injection` → `buildLanguageDirective()`. The shared block is wedged in front of the runtime block by `bus.ts::concatSharedRules`; the language directive is appended last by `appendLanguageDirective`. **No `## Current xxx` / "current state" block at the top of the file** — anything the LLM itself rewrites mid-session (`<agent>` writeback / `<<<skill-file>>>` / `plan_set` / form submissions: `$name` / `$description*` / `$workflow` / `$skill_dir` / `$skill_files` / `$plan_state` / `$agents_index` / `$inputs_schema` / `$interactive`) goes only into the trailing runtime section. **Why:** putting volatile fields up front means the very next turn rewrites the cache prefix and we eat a full re-prefill; `chat_agent_setup.md` / `chat_agent_setup_cli.md` / `chat_skill_setup.md` shipped with a top-of-file `## Current agent` / `## Current skill` block, every edit turn invalidated the cache, and the fix was to consolidate those into the trailing `## Runtime injection` section. Same applies to any new prompt md added under `src/main/prompts/`. Path-constants that are fixed for the lifetime of a session (`$builtin_*_dir` / `$custom_*_dir` / `$working_dir`) are session-stable and may stay inline in the body; only fields that the LLM or bus mutate within a session are forbidden in the prefix.---diff --git a/src/main/prompts/chat_agent_in_group.md b/src/main/prompts/chat_agent_in_group.mdindex 220009bc..40737218 100644--- a/src/main/prompts/chat_agent_in_group.md+++ b/src/main/prompts/chat_agent_in_group.md@@ -94,7 +94,7 @@ Send form → bus marks the step `blocked` (plan paused) → user fills it in th- **Do not** re-send a form before the previous one has been answered.-### Mandatory confirmation triggered by `inputs_schema`+### Handling `inputs_schema` (extract first, form only when info is missing)The "Runtime injection" section at the end lists your `inputs_schema`. If it is **non-empty**, the first time the user / commander dispatches you:@@ -103,8 +103,8 @@ The "Runtime injection" section at the end lists your `inputs_schema`. If it is- **Commander dispatch**: the commander writes parameters in natural prose; pick them up by phrase matching against `label`.2. **Self-check** each candidate: strong evidence (the inbound literally states the term or an obvious synonym) vs. guessing.3. **Decision branches**:- - **Every required field filled with strong evidence** → don't send a form, just start the work; the extracted values are enough to keep in your head.- - **Otherwise** → send **one** form. **Every value you extracted — even one token, even one field — MUST be copied into that field's `default` before the form goes out.** A field's `default` stays empty / unchanged ONLY when the inbound carries zero signal for it. The lead-in line before the form must call out what you inferred: "I inferred these — please confirm: X=...; Y=...".+ - **Every required field has a usable value — strong-evidence extraction from the inbound OR a non-empty `default` declared in the schema** → **execute directly, no form**. A schema `default` is the agent author's declared safe fallback for "user didn't specify"; don't re-route through a confirmation form just to re-show defaults. Lead with one short line listing what you used (e.g. "Inferred: keyword=…; defaults: source=…; output_dir=…") and **start the work in the same turn** — no "please confirm" / "shall I start" pause.+ - **Otherwise — a required field has neither extraction NOR a non-empty `default`** → send **one** form for just that gap. **Every value you did extract — even one token — MUST be copied into that field's `default`.** A `default` stays empty ONLY when both the inbound carries zero signal AND the schema didn't declare one. The lead-in names what's missing AND what's inferred: "Need: <missing field>. Inferred: X=…; Y=…".4. After the user replies with `<agent-input-submission>`, do the work — **do not** send a second form.---@@ -135,7 +135,7 @@ The "Runtime injection" section at the end lists your `inputs_schema`. If it is$workflow```-### inputs_schema (fields the user confirms each time they run you; the trigger logic is in the "Interacting with the user" section above)+### inputs_schema (fields you may need from the user; trigger logic above in "Interacting with the user")$inputs_schema### Working directory