Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
2cbd7cd
Goals: keep an agent working until a check command passes
claude Oct 29, 2026
263c4d6
Merge main into goals
claude Oct 29, 2026
2380cad
Goals: the lead-reaction test's lookout gets its goals
claude Oct 29, 2026
8fd8d02
Goals: answer Codex's review
claude Oct 29, 2026
99136ee
Merge main into goals
claude Oct 29, 2026
31231ed
Triggers: restamp reads the job file by its new name
claude Oct 29, 2026
bf1e342
Goals: answer Codex's second review
claude Oct 29, 2026
1a44323
Merge main into goals
claude Oct 29, 2026
e79ca99
Goals: a turn its check holds is not judged, and a goal given up whil…
claude Oct 29, 2026
97d3e40
Goals: a goal set again counts its turns without a tool from 0
claude Oct 29, 2026
6aa2f0e
Goals: a dropped connection stops the checks under way, which the rep…
claude Oct 29, 2026
e160377
Goals: a stopped check takes what it started with it, and a replayed …
claude Oct 29, 2026
025fab9
Goals: the lead hears how a goal ended in the lookout's words only
claude Oct 29, 2026
e849c96
Goals: a lookout giving way stops its checks, and only a heard task's…
claude Oct 29, 2026
09f8d93
Goals: a check runs where its turn worked, and how a goal ended survi…
claude Oct 29, 2026
81aa809
Goals: a check goes without every provider key an agent's shell does
claude Oct 29, 2026
82305f6
Goals: tests for a goal its lead sets, a turn that ends mid-check, an…
claude Oct 29, 2026
13863f4
Goals: a turn the lead's wait read still says how its goal ended
claude Oct 29, 2026
576f788
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Oct 29, 2026
06ed6d2
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Oct 29, 2026
cb125bc
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Oct 29, 2026
acf562c
Goals: the held-turn test asks due() as main's lookout has it
claude Oct 29, 2026
a9f51b9
Goals: a check under way keeps the replay cursor before its turn, wat…
claude Oct 29, 2026
968a2e5
Goals: a wait that reads a turn leaves how its goal ended to tell
claude Oct 29, 2026
48a7962
Goals: a trigger passing a turn's answer on leaves how its goal ended…
claude Oct 29, 2026
107d22e
Goals: deleting an agent stops its check
claude Oct 29, 2026
e7083fd
Goals: a goal set again while its last one is checked is checked afresh
claude Oct 29, 2026
b3c9ede
Goals: how a goal ended is news even while the lead waits on its turn
claude Oct 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/LOOKOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ those with subscriptions of their own:
- a running turn that has printed nothing for 30 minutes, once per
silence; a turn waiting on the person, on other turns or for a slot is
not silent;
- a task's turns its goal (SONNY.md) held, once the goal ends: only the
last, with how it ended (``turn:calc.fix/4 completed, asked by goal,
and met its goal: its check exits 0``);
- turns the person asked for in a task themselves, listed apart as theirs;
- what was saved to or removed from the person's and the project's memory,
by path, less what the subscriber saved itself: the folders its own
Expand Down
37 changes: 37 additions & 0 deletions docs/SONNY.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,43 @@ its folder rather than trusting a compacted conversation for ids and times,
report a source it could not read by name, re-check items right before
posting, and record a post only once the destination confirms it.

## Goals

A goal keeps an agent working until a command says its work is done, with
no judge and nothing in the daemon ([goals.rs](../sonny/src/lookout/goals.rs)).
An agent sets one with the `goal` tool, on itself or on a task it made:
`set {done_when, check, bot, budget_tokens, timeout_s}`, `blocked` WHY to
give its own up, `clear` NAME, or nothing to list them. The check is a
shell command (`cargo test`, `make lint`, `test -z "$(git status --short)"`)
that exits 0 once done; the lookout runs it in the agent's folder, as the
person and outside any sandbox like a trigger's `if`, though without the
provider keys an agent's shell goes without, so `set` waits for a verdict wherever the
agent's other calls do (`/approvals`). Each goal is
`STORE.lookout/goals/BOT.json`; setting the same goal again changes
nothing.

Each time a turn of that agent completes, the lookout runs the check, for
up to `timeout_s` (600 when left out, at most 3,600), killing its process
group past that. While it fails, it queues the agent a turn (origin
`goal`) with its exit code and the last 60 lines (8 KiB) it printed:

```
Your goal is not met yet: `cargo test` exits 101.
...
Keep working until the tests pass. When no way remains, give the goal up with the goal tool's blocked, saying why.
```

The goal ends, and its file goes, at the first of: the check exits 0; the
agent's tokens since `set` reach `budget_tokens`; two turns in a row that
the goal started call no tool, since the agent only answers and another
turn would too; the agent calls `blocked`; or someone clears it or the
agent is deleted. A turn that fails or is stopped ends nothing and starts
nothing: the lead hears it as any turn. Its lead hears none of the turns
the goal held until the last, told with how the goal ended (below). That
line is the lookout's own words only: the agent's reason for giving up,
and a check it set itself, are its text, which the lead reads in the turn
or with `goal`.

## Memory

Memory is what earlier agents learned that a later one needs: decisions,
Expand Down
3 changes: 2 additions & 1 deletion sonny/src/approvals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,8 @@ mod tests {
"new_project",
"subscriptions",
"run_in_pane",
"triggers"
"triggers",
"goal"
])
);
}
Expand Down
Loading
Loading