Codex 多智能体编排提示词:主模型写码、架构师按需审查
一条可复制的 Codex 配置提示词:分层模型树加按需唤起的架构师代理,降低编码成本。
原始内容
Codex tip: once GPT-6.1 Sol is your main model, stop running Astra on every turn put Astra on call as an architect agent GPT-6.1 Sol keeps writing the code Astra only gets spawned at three points: → before a plan: is this the right approach? → when the same error comes back: am I digging in the wrong place? → before "done": what did I miss? Astra reviews. Sol ships Jev engineering is the same move one layer down: the forks that need no thinker (which file, which tool, retry or stop) go to Jev in under half a second, and the big models only see the ones that split - the full tree > GPT-6.1 Sol on high runs the main session > explorer reads the code on Luna > worker edits and runs tests on Sol > researcher pulls the docs on Luna > all three on medium > Astra on call as the architect > auto_review checks every approval paste the tree and this prompt into Codex ↓ "Rebuild my Codex setup around this tree: 1. Check ~/.codex/agents and .codex/agents for agents that already fit explorer, worker and researcher. > Draft new TOML files only for missing roles > explorer and researcher on gpt-6-luna, worker on gpt-6.1-sol, all with model_reasoning_effort medium > Add an architect agent on gpt-6-astra, model_reasoning_effort high, whose only job is reviewing plans, repeated errors and finished work > Skip any that pin a different model and list them 2. In ~/.codex/config.toml set model to gpt-6.1-sol, model_reasoning_effort to high and approvals_reviewer to auto_review 3. Find anything that would override this (active profiles, flags in my shell aliases, agents.default_subagent_model). Report it, change nothing 4. Add one rule to AGENTS.md: spawn the architect before a large plan, when an error repeats, and before calling a long task done Show me every change as a diff first. No edits until I say go." ↳ https://t.co/eyMF8gZKLE
Jev Engineering: How to Stop Paying a Frontier Model to Make Yes-or-No Decisions (full course) Open the trace of any agent you have shipped and count the calls. A model picks the next tool. A model judges whether the result is good. A model decides if the task is done. A model checks whether the command is dangerous. A model scores which retrieved passage is worth keeping. Five calls. Four of them produced no text you will ever read. You paid generation prices for a routing decision. You waited three to thirty seconds for a word your code was going to turn into a branch anyway. And you wrote a parser, a validator and a retry for a response that was only ever going to be one of three values. On September 15, 2026, TypeSafe AI came out of two years of stealth with $40M led by DCVC and released a model built for exactly those four calls. It is called Jev, and it cannot write a sentence. That limitation is the entire product. I spent almost a week pulling this apart and built the whole thing out as a course. If you want the setup end to end instead of the summary, it lives here: > https://jev-engineering.site Below is the working version. Ten steps, real code, and the parts the launch posts left out. --- ## The Jevons Paradox, and why your bill never goes down Jev is named after an economics rule from 1865. William Stanley Jevons noticed that when steam engines started burning coal more efficiently, Britain did not burn less coal. It burned dramatically more. Efficiency made coal worth using in places nobody had bothered with, and total consumption exploded. Tokens get cheaper every quarter. Your bill does not. Every price drop opens a new place to put a model call, and the calls multiply faster than the price falls. The loop that ran a model three times last year runs it eleven times now, because each one got cheap enough to justify. TypeSafe's bet is that the way out is not a cheaper model doing the same job. It is a different kind of model doing a job the first one was never built for. --- ## 01. Split - find the decisions, not the text Every agent loop is made of three kinds of operation, and almost every stack collapses two of them into one. Generation makes something that did not exist. Research, prose, code, an explanation of a failure. That needs a frontier LLM and always will. Execution does the thing. Call the tool, write the file, stop after ten actions, hold the spending cap. That is code, it is free, and it never changes its mind. Decision sits between them. Which worker runs next. How risky is this change. Should a person see it. The answer space is known before you ask, and the answer is going straight into an if statement. I am going to build one thing across this article: a gate that reads a code change and decides whether it ships, goes back, or needs a human. I picked it because every team already has this decision and almost everyone either does it by hand or burns a frontier call on it. The split has one rule and it fits in a line: if the operation creates text, it stays with the LLM. If it picks an option, scores a value, or answers yes or no, it goes to Jev. That is Jev engineering. Everything below is how to wire it. --- ## 02. Playground - test one question before you write any code Open the TypeSafe Playground and sign in. Access is by waitlist and people are getting approved the same day, but check before you plan around it. Paste this as your state: ```json { "files_touched": ["api/auth.py", "api/session.py"], "lines": {"added": 34, "removed": 9}, "tests": "12 passed, 0 failed", "migrations": false, "plan_said": "refactor token refresh only" } ``` Add one Choice question: what should happen to this change? Define three options. Ship when tests pass and the diff matches the plan. Return when the diff goes beyond what the plan described. Escalate when the change is irreversible or touches something the plan never mentioned. Run it. Then flip migrations to true and run it again without changing anything else. Watch the distribution move. That is the whole interaction, and five minutes here will teach you more than the docs. --- ## What Jev actually is TypeSafe calls it a System One model, after Kahneman's split between fast intuitive judgment and slow deliberate reasoning. The shortest accurate description is a semantic decision engine. You send two things. State - the text or JSON describing the situation right now. A diff summary. A support ticket. An order book snapshot. Whatever your code already has in memory. Questions - the decisions you want made about that state, each one declaring its answer shape in advance. What comes back is typed answers with probabilities. No prose. No JSON to repair. No fourth option the model invented because it felt like it. The mental model that stuck across every write-up I read: an LLM maps state to text, Jev maps state to a decision distribution. Ordinary code branches on values it can compute. Jev branches on values it cannot. if (diff.lines_added > 400) is something a computer can check. if (this change goes beyond what the plan described) is not, and that gap is the whole reason you have been renting a chat model. --- ## 03. SDK - install it and connect the API You need an account with API access enabled and a key from the dashboard. Calls are billed to that account. Install Python 3.12 or newer, then open your terminal. ```bash python3 -m venv .venv .venv/bin/python -m pip install --upgrade typesafe-sdk ``` On Windows the two lines are py -3 -m venv .venv and .\.venv\Scripts\python.exe -m pip install --upgrade typesafe-sdk. Put the key in your environment rather than your source: ```bash export TYPESAFE_API_KEY="your-key" ``` If you use a coding agent, add the official skill so it writes correct calls: ```bash npx skills add typesafe-ai/skills --skill typesafe-ai ``` Pick your agent when prompted. The skill gives it integration instructions. Jev itself still runs through the API. --- ## 04. State - build the snapshot in code, not in the model The single biggest mistake I made in my first hour was handing Jev the raw diff and hoping. Everything computable stays in code. Line counts, file paths, test exit codes, whether a migration file exists, whether the diff strays outside the planned paths. None of that needs a model, and paying one to count is how you end up with a cheap model that costs more than the expensive one. ```python def snapshot(diff, plan, test_exit): planned = set(plan["paths"]) touched = set(diff.files) return { "files_touched": sorted(touched), "outside_plan": sorted(touched - planned), "lines": {"added": diff.added, "removed": diff.removed}, "tests": "passed" if test_exit == 0 else "failed", "migrations": any(f.startswith("migrations/") for f in touched), "plan_said": plan["summary"], } ``` Six fields, all deterministic, and it is under 200 tokens. That is the whole input. Keep it dense and keep it honest. Every field you add gets read on every call, and irrelevant context lowers accuracy rather than raising it. --- ## 05. Questions - Choice, Score and Noul There are exactly three question types. That is the complete API surface. Choice picks one option from a list you define, up to 255 of them, and returns a probability for every option plus a confidence. Score places the state on an ordered scale you define. Define three rungs and the result runs 0 to 2, fractions included. Noul answers a yes-or-no question by returning the probability that it is true. The name is odd; what matters is that you get a number between 0 and 1 your code can act on. All three mix in one request: ```python from typesafe_sdk import Choice, Noul, Score, TypeSafeClient QUESTIONS = { "verdict": Choice( instructions="What should happen to this change?", criteria={ "ship": "tests pass and the diff stays inside the plan", "return": "the diff goes beyond what the plan described", "escalate": "irreversible, or touches something unplanned", }, ), "blast_radius": Score( instructions="How hard would this be to undo?", legend={"0": "one file, revert it", "1": "several files", "2": "data or schema, cannot revert cleanly"}, ), "needs_human": Noul( instructions="Should a person read this before it merges?", ), } ``` Two details that will save you a week. Jev does not see your question ID. Naming a field needs_human contributes nothing at all. The requirement goes in the instructions and in the description of each option, not in the variable name. And supply evidence, not summaries. "The tests ran" tells Jev far less than which files moved, what the plan said, and where the two disagree. --- ## 06. The gate - one call, three answers, your thresholds Here is the whole decision, and it is shorter than the state builder: ```python with TypeSafeClient(model="jev-1.13.0") as client: r = client.system_one(state=snapshot(diff, plan, test_exit), questions=QUESTIONS) v = r.choices["verdict"] radius = r.scores["blast_radius"].score human = r.nouls["needs_human"].p if radius >= 1.5 or human >= 0.70: decision = "escalate" elif v.choice == "ship" and v.confidence >= 0.88: decision = "ship" else: decision = "return" ``` Read that bottom block carefully, because it is the part people get wrong. The hard rule wins first. Blast radius outranks the verdict, always, no matter how confident the verdict was. A model does not get a vote on whether something irreversible is allowed through. Then the confident path. Then everything else falls to return, which is the cheap failure. Thresholds live here, in code, where you can review them in a pull request. Write one per action, scaled to what being wrong costs. 0.88 on ship is a placeholder until you have labelled examples of your own; confidence is not an accuracy percentage and treating it as one is the fastest way to ship a bad gate. --- ## The probabilities are the product A typed answer solves half the problem. The distribution solves the other half. Here is what actually comes back: ```json { "verdict": { "choice": "ship", "probabilities": {"ship": 0.52, "return": 0.46, "escalate": 0.02}, "confidence": 0.18 }, "blast_radius": {"score": 0.4, "confidence": 0.81}, "needs_human": {"p": 0.31, "confidence": 0.77} } ``` Ship won. It won by six points over return, and the confidence is 0.18. Merging that automatically would be reckless, and you would never have known from the label alone. An LLM would have said "looks good to ship" in a confident sentence and told you nothing about how close the race was. This gives you a pattern you can write once and reuse everywhere: > - high confidence, small consequence: act automatically > - medium confidence: confirm, or escalate to a stronger model > - low confidence: send it to a person, or go collect more state Jev is trained with Reinforcement Learning for Calibrated Decisions, which optimises probabilities against real outcomes rather than human preference. The intent is that across many predictions, answers tagged 90% are right about 90% of the time. Verify that on your own data before you lean on it. Calibration is measured across groups; it never promises any individual answer is correct. --- ## 07. Parallel - batch the questions into one call This is the part that changes how you design the loop, and it is the part most people miss on the first read. System One models evaluate every question in a request in parallel and in isolation. Adding a sixth question barely moves the clock. It costs the tokens for that question and nothing else. So stop asking one question and waiting to see what to ask next. My gate asks three. It could ask eight for the same wall clock: does this touch auth, does it add a dependency, is the test coverage on the changed lines real, does the commit message match the diff. Somebody already shipped exactly that shape, pointed at a feed instead of a diff. Eight questions per post, three days of posts, about two seconds and seven tenths of a cent for the entire run. It strips the bait and the undisclosed ads, and it weighs the like-to-reply-to-repost ratios next to the text rather than trusting either signal on its own. [Embedded Tweet: https://x.com/i/status/2101074194260000982] Eight questions is not eight times the work. That is the whole reason the primitive exists, and it is why the batch, not the question, is the unit you should be designing around. One question is a demo. The full battery in one call is the professional pattern, and the batching economics reward it heavily. The constraint worth memorising: questions cannot read each other's answers. If a decision depends on a fresh search result, run the search first and ask in a second request. Isolation is exactly what buys the parallelism. This is the point where most people want a working router in front of them rather than a snippet. That is module three of the course, with the queues, the thresholds and the shadow-mode setup already wired: > [https://jev-engineering.site](https://jev-engineering.site/) --- ## 08. Dynamic menu - rebuild the options every turn A browser's available actions change after every click. Browser Use builds a fresh list of the controls it can actually see and lets Jev choose from that list. A small LLM only steps in when a field needs text typed into it. Apply that design to your own router. Build the choices from what exists right now. If your gate can route to three reviewers, send the two who are actually online. If it selects among retrieved passages, send the IDs you currently hold, not the ones from the last run. Otherwise your decision model is choosing from yesterday's menu, and it will keep picking a reviewer who left the team or a source you deleted an hour ago. For large candidate lists, filter the obvious mismatches in code first, score what remains, then choose among the shortlist. Choice handles up to 255 options, but the cheapest option is always the one you never sent. --- ## 09. Guardrails - the harness is the difference There is a claim in the TypeSafe material worth sitting with: the harness is the difference between 78% and 42% on the same model. Same weights, different loop engineering. Coding harnesses have shipped some version of this for a while. Claude Code, Codex and Cursor all classify dangerous actions before they run. That classifier step is a large part of why people started trusting agents at all, and until now it lived in the closed parts of those products. Now the pattern is available to everyone, because a cheap performant classifier exists. LangChain's middleware shows the shape in four lines: ```python from langchain.agents import create_agent from langchain_typesafe.experimental.middleware import AutoModeMiddleware guardrail = AutoModeMiddleware(tools=["bash"]) agent = create_agent("openai:gpt-5.6-luna", middleware=[guardrail]) ``` Every tool call gets checked before execution. Risky ones blocked, safe ones approved, zero generation tokens burned on the check. The same idea runs at the other end of the stack as a model router. Jev reads the request, picks the cheapest model likely to complete it, and your expensive model only wakes up for work that needs it. Neither layer writes a word. Neither adds latency you can feel. Beyond that, your application still needs the boring parts. An action limit. A spending limit. Saved progress. After an interruption it should inspect the last completed action before repeating anything, because a confident answer cannot prove that a file was written or a branch was merged. Browser Use checks the outcome independently after Jev returns DONE, and that separation is worth copying. --- ## 10. Cost - what four cents a million actually buys Jev is $0.042 per million input tokens. Output tokens are free. At roughly 1,000 billed input tokens per decision, ten thousand decisions cost $0.42 in inference. The same ten thousand forks on a frontier model, at three cents a call, is $300. That is arithmetic, not a benchmark, and it is the honest version of the pitch. The benchmark numbers are softer and you should treat them that way. On TypeSafe's own four-workflow evaluation, Jev lands around 68% agreement with a frontier consensus, close to mid-tier LLMs, at a fraction of the cost. The headline multiples of 200x faster and 400x cheaper come from the vendor's own evaluations and sit at the favourable end. Treat them as a ceiling, not a promise. What people shipped in the first 72 hours is more persuasive than the eval table. Browser Use wired Jev into a browser agent that found flights in 7 seconds for $0.0039. Worth reading the fine print: the clock starts after the first page observation, and the agent finds results rather than booking anything. Hassan classified 1,018 AI research papers for $0.08 total, at 256ms median per paper. Riley Brown classified 500 emails in seconds for three and a half cents. Alex Volkov ran it as a Claude plugin to score tool calls for relevance and dropped a session from nearly 1M tokens to 86K in one second. That is not summarisation. That is a relevance filter running at Jev speed. Those are all single runs. The one that turns the arithmetic into a business number is an agency whose SEO audits used to cost about $250 each. Same clients, same deliverable, and the bill fell by roughly ninety percent. [Embedded Tweet: https://x.com/i/status/2101090579127951694] Read their breakdown line by line, because not one of the nine speedups is generation. Reading analytics, checking what gets cited, sorting which page types get picked, gap analysis across thousands of pages. Every one of those is a decision over known options, and every one of them had been quietly charged at frontier prices. Track the bill per completed task, not per call. A cheap decision that returns a good change for no reason costs you a human round trip, and that is more expensive than any model call in this article. --- ## The hallucination claim needs one correction TypeSafe says Jev cannot hallucinate. That is true only under a narrow definition, and the narrow definition matters. Jev cannot return an option outside your schema. Define ship, return and escalate, and it cannot invent revert. It cannot hand back malformed prose where your code expected a label. It can absolutely choose the wrong valid option, with confidence. Type safety prevents invalid shapes. It does not guarantee correct judgment. A schema-valid mistake will still merge the change that breaks production. The accurate sentence is: Jev cannot break the declared output schema, but it can still be wrong. Anyone selling you the shorter version has not shipped this into production. --- ## Where it does not belong Jev stops being useful the moment the answer space stops being known. It cannot write, summarise, generate code, or explain itself. It is unreliable at arithmetic, counting, date comparison and exact string manipulation, so keep those in code, where they were always faster and cheaper anyway. It struggles when a decision needs several hidden reasoning steps, so split the judgment into smaller questions or use a reasoning model. It cannot extract an unknown value; find the candidates first, then let it choose among them. Irrelevant context lowers accuracy, which is the opposite of the instinct most of us built up with LLMs. Send only the state the question needs. And the rule that outranks all of them: if deterministic code already solves it correctly, keep the code. My gate does not ask Jev whether the tests passed. It reads the exit code. One more honest caveat. Closed weights, early access, text-only input, no independent calibration data yet. Too early for blind trust. --- ## Rollout - without creating a new failure mode A cheap model can still be expensive if its mistakes create retries, manual review, or incidents. Measure the whole workflow, not the token price. The sequence that works: - pick one bounded, low-risk decision where you can name the possible answers - write the rubric before you call the model, and define what belongs in each option - collect real examples with expected answers, including the ambiguous and adversarial ones - run it in shadow mode beside your current logic, changing nothing - plot accuracy against confidence and set your thresholds from that curve, not from a blog post - automate the safest branch first, keep a human or a stronger model on the uncertain ones - pin the model version, and log the questions, criteria and thresholds so any change can be replayed That last one is the discipline most teams skip. Your questions are part of your program. Version them, review them, and re-run your evaluation set whenever the model or the rubric changes. I ran my gate in shadow mode for two days before it was allowed to block anything. It disagreed with me eleven times. Nine of those were my thresholds, not its judgment, and I would never have found that from a demo. --- ## What actually changed Jev is not interesting because it beats an LLM at writing. It refuses to write. What it contributes is a model interface shaped like software instead of like conversation: fixed answer types, explicit uncertainty, parallel questions, and branching that stays in your code where you can review it. The real finding is not the 7-second flight demo or the $0.08 classification run. It is how many expensive calls inside your agents never needed generation in the first place. Let the LLM research, plan and write. Let Jev route, score, approve and escalate. Let code execute the decision. That split changes the whole stack, and it survives whichever model eventually replaces Jev. Most builders will keep spending frontier tokens on every yes, no, route and score, because it works and nobody is auditing the trace. The ones who separate thinking from deciding will ship faster agents for a fraction of the bill. Everything above is the map. The course is the walkthrough: ten steps from a blank terminal to a decision layer with real thresholds, plus the five production patterns that already shipped: > [https://jev-engineering.site](https://jev-engineering.site/) Start with one decision. Give it the minimum state. Log its probabilities beside whatever you do today, and let it earn one branch before you hand it the loop. Most of what you are paying a frontier model to do this week is not thinking. It is choosing. --- Don't forget to follow me and subscribe my Telegram channel: https://t.me/+75nMf005jRpjMDU1
深度解析
是什么:一条可复制的 Codex 多智能体配置提示词与配套架构图。作者主张用 GPT-6.1 Sol 以高推理强度跑主会话负责规划与写码,explorer/worker/researcher 以 medium 强度并行分工(读码、改码跑测试、拉文档),Astra 作为「架构师」按需唤起,auto_review 审查每次批准,并用一段结构化 Prompt 让 Codex 自检现有 agents、补齐缺失角色的 TOML、改写 config.toml 并在 AGENTS.md 加入触发规则。
核心设计:三个机制——(1) 角色分层:贵模型只做规划写码,读码/查文档降级到低成本模型;(2) 事件触发的审查:架构师只在「定计划前、错误重复时、宣告完成前」介入,而非每轮陪跑,且「永不亲自写码,由 Sol 落实其意见」;(3) Jev 分流层:把「改哪个文件、用哪个工具、重试还是停」这类高置信决策(p≈0.87–0.97)直接在代码层解决,模糊的才 split 给主模型。三帧图显示 forks 从 1,365 涨到 1,705、Astra 调用与 token 同步上升,呈现运行时可观测状态。
关键洞察:「Astra reviews, Sol ships」——把审查做成门控事件而非持续运行,是质量与成本兼顾的编排思路;「先看 diff,未确认不改动」体现了对代理修改本机配置的安全边界。
边界与风险:GPT-6.1 Sol/Luna/Astra 等模型名无法在公开资料中核实,Jev 概率数据属演示性质;引用推文与 X 文章不可访问,外链 ChatGPT Learn 页面基本是导航目录,佐证有限;照搬该 Prompt 会改动 ~/.codex 配置,务必人工审阅 diff 并留意作者提醒的 profiles、shell 别名等覆盖项。