Skip to content

Run every judge on Bedrock: the lookout on any daemon model, and one AGENT_JUDGE setting - #168

Merged
lydakis merged 28 commits into
mainfrom
claude/project-thread-nzse3y
Oct 26, 2026
Merged

lydakis merged 28 commits into
mainfrom
claude/project-thread-nzse3y

Conversation

@lydakis

@lydakis lydakis commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

What

George will only have Bedrock tomorrow, so everything that judges has to run on a Bedrock model, from one setting.

  • The lookout can now judge with any model the daemon runs. With --lookout PROVIDER/MODEL (for example bedrock/global.anthropic.claude-haiku-…), each check forks an idle bot named lookout.<hash of model and instructions>. That bot has no tools and holds the judge's instructions. The fork takes one turn that answers every question as a JSON object, read with the approver's model_answers, and is then deleted. This is the approver's model-judge pattern. When the lookout starts, it removes forks left by a Sonny that is no longer running (their PID is in the name).

  • How the lookout picks its judge:

    1. --lookout SPEC
    2. else AGENT_JUDGE, read from the shell or ~/.agent/env
    3. else openai-decisions/gpt-6-luna when OPENAI_API_KEY is set
    4. else the newest Haiku the lead's provider lists, preferring the lead's Bedrock region prefix such as global.
    5. else off, with a one-line notice

    --lookout off still turns it off.

  • AGENT_APPROVER_JUDGE is renamed AGENT_JUDGE (CLI, help text, docs and the one test), so a single line sets both the approver and the lookout. Sonny and the app already pass ~/.agent/env to the approvers they start. There's no alias, since George is the only user.

Tests

  • tests/test_lookout.py (new, runtime): runs sonny lookout-replay --judge openai/judge-model against a stand-in model served by the daemon. Both checks are answered through forks, the finished turn wakes the lead on result, the judge request has no tools, and only the base bot is left afterwards.
  • tests/test_approvals.py: all 42 pass with AGENT_JUDGE.
  • cargo test -p sonny: 89 pass, including the Haiku-pick test. cargo clippy -p sonny -p agent-runtime --all-targets is clean.

Not measured yet: Bedrock latency and cost per check, because the cloud can't reach Bedrock. On the stand-in, a check through the daemon took about 50 ms of overhead.

claude added 25 commits October 26, 2026 02:49
--lookout openai-decisions/MODEL (or typesafe/jev-*) follows every bot,
checks each message someone other than the lead writes in one of the lead's
tasks, each turn a task ends and each approval left waiting two minutes,
with a few yes/no predicates over the event, the task's brief, the other
tasks and the memory indexes. A high answer wakes the lead (steering for a
change of direction or a conflict, else queued), a middle one waits for the
next wake or a 30-minute digest, a low one is only logged to
~/.agent/sonny/lookout.jsonl. Off by default; the daemon is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013BJVqR47cCbbWHuxEdaCJD
For every project lead, its tasks' retained events go through the same
event rules as the live lookout; each check is asked of every --judge and
printed as a JSON line, waking no one. demo/lookout_score.py scores a run
against hand labels and the app's digest wake.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013BJVqR47cCbbWHuxEdaCJD
A message is read by the history node its events name, so a steer shows
the judge its own words; a task's brief is the lead's latest message to it
as of the event; queued work is checked when queued, not when it starts;
the same words in several tasks (a board post) are checked once; a steer
wakes the lead without waiting out the gap; each note line names what the
lead should do; and a new question asks whether a finished turn has a
result the person would want to hear.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013BJVqR47cCbbWHuxEdaCJD
A message from the person in a task is what it works to next, so later
checks read it as the brief and a reply that follows it is not off brief.
`result` no longer counts acknowledgements and plans as results.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013BJVqR47cCbbWHuxEdaCJD
George wants a lookout note to count as his permission, so the lead can
pass on or save what he said without an approval prompt. The note is
submitted without an origin, which the approver reads as the person's
words; its request id still starts with lookout-. Since the approver now
trusts the note, it quotes only the person's own words: a task's text
quoted there could ask for anything.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013BJVqR47cCbbWHuxEdaCJD
A preference the person gives one task both redirects the others and
belongs in memory; naming only the top reason's action told the lead to
pass it on but never to save it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013BJVqR47cCbbWHuxEdaCJD
George asked for it on by default after the real runs. The judge is
openai-decisions/gpt-6-luna unless --lookout names another; --lookout off
turns it off. Without OPENAI_API_KEY it stays off and says so in one line.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013BJVqR47cCbbWHuxEdaCJD
…hannel

The channel question said "the agent daemon's store", and judges read
every call under ~/.agent as that, so no bot in auto mode could save
memory, even when the person asked. It now names the daemon's database
and socket, and says the memory script and task worktrees are not the
channel. George asked that bots save memory on their own.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013BJVqR47cCbbWHuxEdaCJD
- A queued message is read whole through prompts, not its 200-character
  preview.
- A completed turn's reply is read from its checkpoint, so a replay or a
  task that has moved on still finds it.
- Startup replay restores each task's brief without checking history.
- An approval timer is cleared only by its own turn's events.
- A bounded note sends wakes first, and what stays held keeps its
  priority.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013BJVqR47cCbbWHuxEdaCJD
- Words checked when queued still become the task's brief when the turn
  starts.
- A note quotes the person's whole message: the lead's wait reads a
  turn's reply, not the words that started it.
- An approval wait on an Anthropic task finds its call inside the
  assistant message.
- A failed check is tried once more, then told to the lead unchecked.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013BJVqR47cCbbWHuxEdaCJD
The limit takes the newest checks by event cursor across every lead,
not the tail of a list grouped by lead, and each judge skips repeated
words per lead, as each lead's live lookout would.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013BJVqR47cCbbWHuxEdaCJD
A task turn that ended after denied calls is checked even when the lead
waits on it, and its status says how many calls were denied, so the
stuck question can wake the lead to ask the person for an approval.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013BJVqR47cCbbWHuxEdaCJD
The lookout reads memory from the folder a moved lead comes back to.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013BJVqR47cCbbWHuxEdaCJD
…icks every judge

The lookout can judge with a provider/model the daemon runs (Bedrock, say), on a
fork of an idle tool-less lookout.* bot, as the approver's judge does. With no
--lookout it reads AGENT_JUDGE, then uses Decisions when OPENAI_API_KEY is set,
then the newest Haiku the lead's provider lists. AGENT_APPROVER_JUDGE becomes
AGENT_JUDGE, so one line in ~/.agent/env sets both judges.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013BJVqR47cCbbWHuxEdaCJD
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T06:30:51.663757Z c1196f0 New commits
🔒 Security Review ✅ Completed 2026-10-26T06:33:58.436373Z c1196f0 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1a591ec6c2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sonny/src/main.rs Resolved
Comment thread sonny/src/lookout.rs Resolved
Comment thread sonny/src/lookout.rs Resolved

lydakis commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

@codex security review


Generated by Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 95e537d0a2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sonny/src/lookout.rs Resolved
@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 95e537d0a2

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@lydakis
lydakis merged commit cf90265 into main Oct 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants