The new loop's core: intake, restatement, go-ahead, threads (M2.1, PR B)
CI / checks (push) Skipped
CI / checks (pull_request) Successful in 1m44s

nisse_dev.loop runs alongside control.py, chosen with `loop: new`.
Issues assigned to the agent (by an operator, or filed by one) become work
items, each with a Matrix thread. A driver run is one model with tools
until it calls a waiting tool: restate puts rev-N up for a go-ahead, bound
to the revision on screen when the reply arrived; ask_human waits for an
answer; close_item closes the item and its issue. Before the go-ahead the
driver can look but not change or close anything. One item is active at a
time; replies in an item's thread go to it. On boot, an item cut off
mid-run waits on the operator, and waiting points are put up again.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PPQ14L3LikyefCMFBqEbKE
This commit is contained in:
dongarandClaude Opus 5.5 committed 2026-10-02 23:46:42 +00:00
1 parent 6dff36f458
commit f84bb70839
14 files changed
+1205 -1

No files matched your search

+49
View File
@@ -0,0 +1,49 @@
"""Control tools (L13): handled in the harness, acting only on the agent's
own state, conversation and records. A *waiting* tool ends the driver's run:
the item then waits on the operator."""
from typing import Any
def _tool(name: str, description: str, **params: str) -> dict[str, Any]:
return {
"type": "function",
"function": {
"name": name,
"description": description,
"parameters": {
"type": "object",
"properties": {
p: {"type": "string", "description": d} for p, d in params.items()
},
"required": list(params),
},
},
}
RESTATE = _tool(
"restate",
"Put your understanding of the request to the operator, in their item's "
"thread: what you take it to mean, how it fits the project, and your "
"first step. Ends your turn; work starts when they agree.",
text="Your restatement, in plain language.",
)
ASK_HUMAN = _tool(
"ask_human",
"Ask the operator a question in the item's thread. Ends your turn; you "
"continue when they answer.",
question="The question.",
)
CLOSE_ITEM = _tool(
"close_item",
"The work is done: close the work item with a summary of what was done, "
"what was verified, and what is left open.",
summary="What was done, verified, and left open.",
)
WAITING = frozenset({"restate", "ask_human", "close_item"})
def names(tools: list[dict[str, Any]]) -> set[str]:
return {tool["function"]["name"] for tool in tools}