Run tasks on Codex beside Claude; drop turn caps and mid-turn snapshots

This commit is contained in:
Ian Gulliver
2026-10-15 14:55:58 -07:00
parent 17898b0191
commit 74707f6398
53 changed files with 1904 additions and 1295 deletions
+14 -7
View File
@@ -13,14 +13,14 @@ import (
)
const guidance = `You are running inside byre. The human reads your work in byre's web UI, not a terminal.
- Ask every question with mcp__byre__ask_human, never in prose.
- Ask every question with byre's ask_human tool, never in prose.
- End every turn with a short final message for the human: what you did, anything you departed from in the plan or instructions, risks, and what's next. byre shows it as the turn's summary in the transcript and the inbox. State every departure from the plan.
- A turn that asks a blocking question files no report; put everything the human needs in the question's context.
- In that final message and in ask_human context, put long supporting detail (logs, full lists, data) in collapsed sections the human expands on demand: a line <details><summary>Title</summary>, the Markdown content, then a line </details>.
- Don't commit. byre commits everything in the worktree at the end of each turn, using the turn's final message.
- Don't push, don't switch or touch other branches, and don't run git maintenance (gc, prune, worktree prune). byre handles merging and pushing.`
const proseQuestionNudge = "Your final message asks the human something in prose. Ask it with mcp__byre__ask_human " +
const proseQuestionNudge = "Your final message asks the human something in prose. Ask it with byre's ask_human tool " +
"(context with the choices inline as `- ( ) choice` / `- (*) recommended` or `- [ ] choice` / `- [x] recommended` list items, question, why_blocked), " +
"then end your turn with a short summary."
@@ -50,18 +50,25 @@ func (m *Manager) bounceProseQuestion(l *live) claude.HookFunc {
return nil, err
}
m.mu.Lock()
defer m.mu.Unlock()
if l.asked || l.bounced || l.compacting || !asksQuestion(in.LastAssistantMessage) {
if !m.takeBounce(l, in.LastAssistantMessage) {
return map[string]any{}, nil
}
l.bounced = true
return map[string]any{"decision": "block", "reason": proseQuestionNudge}, nil
}
}
func (m *Manager) takeBounce(l *live, final string) bool {
m.mu.Lock()
defer m.mu.Unlock()
if l.asked || l.bounced || l.compacting || !asksQuestion(final) {
return false
}
l.bounced = true
return true
}
func (m *Manager) taskGuidance(ctx context.Context, task api.Task) (string, error) {
g := guidance + fmt.Sprintf("\n- This task's ports are %d to %d; $PORT holds the first. Run dev servers and anything else that listens on these, so parallel tasks don't collide, and listen on 127.0.0.1. To show the human a running server, call mcp__byre__expose_port."+
g := guidance + fmt.Sprintf("\n- This task's ports are %d to %d; $PORT holds the first. Run dev servers and anything else that listens on these, so parallel tasks don't collide, and listen on 127.0.0.1. To show the human a running server, call byre's expose_port tool."+
"\n- This worktree starts with only what git tracks. Before other work in a new worktree, do any setup the project's AGENTS.md describes.",
task.PortBase, task.PortBase+store.PortBlock-1)
if task.TodoItem != nil {