Runs that go in circles end (M7.8)
Driver.run checks each turn with nisse_core.loop.circles and ends the run as "circling" when the same calls get much the same back, one harness correction is given again and again, or the model apologises, for circle_repeats turns in a row (default 3). Near-identical calls (git add a.py, b.py) and scattered apologies stay flags on the status page. A fact in the transcript says why the run ended. nisse-dev calls in a helper as for a stuck run, then asks the operator; nisse-review counts a failed run and posts none of its drafts. Tuning: tuning.driver / tuning.review circle_repeats (0 off) and circle_similar. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J5Utyfzw7gF7UhjRDEtjTk
This commit is contained in:
1 parent
516a328618
commit
74bc68db1c
20 files changed
+506
-20
No files matched your search
@@ -249,6 +249,49 @@ def test_stuck_again_in_the_same_milestone_asks_the_operator(
|
||||
assert len(helper.calls) == 2 # one delegation: its two turns
|
||||
|
||||
|
||||
def test_a_driver_going_in_circles_gets_a_helper_too(world: dict[str, Any]) -> None:
|
||||
# L2, M7.8: the same command, the same output, turn after turn.
|
||||
helper = Spy(
|
||||
[call("write_file", path="fixed.py", content="F = 1\n")],
|
||||
[hand_back()],
|
||||
)
|
||||
model = ScriptedModel(
|
||||
RESTATE,
|
||||
[call("start_milestone", name="words")],
|
||||
*[[call("run_command", command="true")] for _ in range(3)],
|
||||
[call("finish_milestone", summary="fixed with help", final="yes")],
|
||||
)
|
||||
agent, transport = loop_agent(world, model, helpers=helpers(helper))
|
||||
agent.intake()
|
||||
say(transport, world, "go")
|
||||
|
||||
assert any("so a helper is taking over" in m.text for m in transport.outbound)
|
||||
assert "near-identical replies in a row" in str(helper.calls) # in the brief
|
||||
assert loop_of(item(world)).helped_at == 1
|
||||
|
||||
|
||||
def test_circling_again_in_the_same_milestone_asks_the_operator(
|
||||
world: dict[str, Any],
|
||||
) -> None:
|
||||
helper = Spy(
|
||||
[call("write_file", path="tried.py", content="T = 1\n")],
|
||||
[hand_back()],
|
||||
)
|
||||
circling = [[call("run_command", command="true")] for _ in range(3)]
|
||||
model = ScriptedModel(
|
||||
RESTATE,
|
||||
[call("start_milestone", name="words")],
|
||||
*circling,
|
||||
*circling, # after the helper: round again
|
||||
)
|
||||
agent, transport = loop_agent(world, model, helpers=helpers(helper))
|
||||
agent.intake()
|
||||
say(transport, world, "go")
|
||||
loop = loop_of(item(world))
|
||||
assert loop.wait == ANSWER
|
||||
assert "I stopped short: 3 near-identical replies in a row" in loop.note
|
||||
|
||||
|
||||
def test_ask_expert_answers_within_its_budget(world: dict[str, Any]) -> None:
|
||||
answer = {"answer": "use a dict", "confidence": "high", "caveats": ""}
|
||||
expert = Spy(
|
||||
|
||||
Reference in new issue
Block a user