mixdog 0.9.40 → 0.9.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/scripts/anthropic-oauth-refresh-race-test.mjs +338 -0
- package/scripts/compact-pressure-test.mjs +128 -0
- package/scripts/compact-trigger-migration-smoke.mjs +8 -8
- package/scripts/internal-comms-smoke.mjs +66 -25
- package/scripts/max-output-recovery-persist-test.mjs +81 -0
- package/scripts/max-output-recovery-test.mjs +222 -0
- package/scripts/provider-toolcall-test.mjs +32 -0
- package/src/agents/reviewer/AGENT.md +4 -0
- package/src/rules/lead/lead-brief.md +11 -3
- package/src/rules/lead/lead-tool.md +0 -2
- package/src/rules/shared/01-tool.md +4 -0
- package/src/runtime/agent/orchestrator/agent-runtime/agent-progress-watchdog.mjs +20 -2
- package/src/runtime/agent/orchestrator/context/collect.mjs +7 -3
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-credentials.mjs +144 -7
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth.mjs +15 -2
- package/src/runtime/agent/orchestrator/providers/anthropic.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/openai-ws-stream.mjs +57 -25
- package/src/runtime/agent/orchestrator/session/agent-loop.mjs +54 -12
- package/src/runtime/agent/orchestrator/session/context-utils.mjs +4 -3
- package/src/runtime/agent/orchestrator/session/loop/compact-policy.mjs +106 -8
- package/src/runtime/agent/orchestrator/session/loop/steering-ladder.mjs +12 -1
- package/src/runtime/agent/orchestrator/session/loop/termination.mjs +22 -7
- package/src/runtime/agent/orchestrator/session/manager/ask-session.mjs +26 -1
- package/src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs +2 -1
- package/src/runtime/agent/orchestrator/session/manager/runtime-liveness.mjs +31 -4
- package/src/runtime/agent/orchestrator/session/pre-send-compact.mjs +11 -2
- package/src/runtime/agent/orchestrator/session/send-with-recovery.mjs +45 -0
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs +22 -21
- package/src/runtime/agent/orchestrator/tools/builtin/builtin-tools.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/shell-command.mjs +9 -10
- package/src/workflows/bench/WORKFLOW.md +51 -27
- package/src/workflows/default/WORKFLOW.md +29 -24
|
@@ -500,6 +500,7 @@ export function execShellCommand({
|
|
|
500
500
|
onProgress,
|
|
501
501
|
clientHostPid,
|
|
502
502
|
backgroundOnTimeout,
|
|
503
|
+
promotedTimeoutMs = 0,
|
|
503
504
|
}) {
|
|
504
505
|
return new Promise(async (resolve) => {
|
|
505
506
|
const taskId = `shell_${randomUUID().slice(0, 8)}`;
|
|
@@ -741,9 +742,8 @@ export function execShellCommand({
|
|
|
741
742
|
// BACKGROUND_MS opt-in) — an EARLIER promotion before the timeout, and
|
|
742
743
|
// 2. the foreground timeout deadline (backgroundOnTimeout) — the default
|
|
743
744
|
// promote-on-timeout that replaces the old tree-kill.
|
|
744
|
-
//
|
|
745
|
-
//
|
|
746
|
-
// the adopted-job cap poll still enforces the 100 MB output ceiling.
|
|
745
|
+
// A capped explicit foreground timeout supplies its remaining deadline to
|
|
746
|
+
// the adopted job; otherwise adoption remains unlimited as before.
|
|
747
747
|
// Mutually exclusive with settle() via the autoBackgrounded flag set
|
|
748
748
|
// synchronously at the top before any await.
|
|
749
749
|
const _autoBackground = async ({ reason = 'threshold' } = {}) => {
|
|
@@ -754,8 +754,7 @@ export function execShellCommand({
|
|
|
754
754
|
if (child.exitCode != null || child.signalCode != null) return;
|
|
755
755
|
autoBackgrounded = true;
|
|
756
756
|
// The foreground capture is over; stop the local watchdogs/timers so
|
|
757
|
-
// they cannot treeKill the now-adopted child.
|
|
758
|
-
// unlimited; refreshShellJob only enforces the output cap.
|
|
757
|
+
// they cannot treeKill the now-adopted child.
|
|
759
758
|
if (timer) { clearTimeout(timer); timer = null; }
|
|
760
759
|
_clearProgressTimer();
|
|
761
760
|
if (sizeWatchdog) { clearInterval(sizeWatchdog); sizeWatchdog = null; }
|
|
@@ -777,14 +776,13 @@ export function execShellCommand({
|
|
|
777
776
|
const stdoutPath = taskOutput.spilled ? taskOutput.stdoutPath : null;
|
|
778
777
|
const stderrPath = taskOutput.spilled ? taskOutput.stderrPath : null;
|
|
779
778
|
let job = null;
|
|
779
|
+
const adoptedTimeoutMs = reason === 'timeout' ? promotedTimeoutMs : 0;
|
|
780
780
|
try {
|
|
781
781
|
job = adoptForegroundShellJob({
|
|
782
782
|
command,
|
|
783
783
|
cwd,
|
|
784
784
|
pid: child.pid,
|
|
785
|
-
|
|
786
|
-
// timeout (matches the async omitted-default behavior).
|
|
787
|
-
timeoutMs: 0,
|
|
785
|
+
timeoutMs: adoptedTimeoutMs,
|
|
788
786
|
mergeStderr: false,
|
|
789
787
|
stdoutPath,
|
|
790
788
|
stderrPath,
|
|
@@ -854,9 +852,10 @@ export function execShellCommand({
|
|
|
854
852
|
outputCaptureError: taskOutput.writeError,
|
|
855
853
|
backgrounded: true,
|
|
856
854
|
jobId,
|
|
855
|
+
backgroundTimeoutMs: adoptedTimeoutMs,
|
|
857
856
|
backgroundMessage: jobId
|
|
858
|
-
? `${_verb}; still running —
|
|
859
|
-
: `${_verb}; still running
|
|
857
|
+
? `${_verb}; still running. Waiting is a decision, not a default: judge from the partial output whether this will finish within your remaining budget — if progress looks slow or stalled, diagnose the cause and pursue an alternative instead of waiting. Completion will be delivered as a background task notification; use task with task_id:${jobId} only for manual wait/status/read/cancel.`
|
|
858
|
+
: `${_verb}; still running — judge from the partial output whether waiting can finish in budget, or diagnose and pursue an alternative.`,
|
|
860
859
|
}),
|
|
861
860
|
);
|
|
862
861
|
};
|
|
@@ -1,36 +1,60 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: bench
|
|
3
3
|
name: Bench
|
|
4
|
-
description: "Autonomous benchmark workflow
|
|
4
|
+
description: "Autonomous headless benchmark workflow with directed execution and parallel cross-verification."
|
|
5
5
|
hidden: true
|
|
6
6
|
agents: worker, heavy-worker, reviewer, debugger, maintainer
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Bench
|
|
10
10
|
|
|
11
|
-
Autonomous: no user. Never
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
1.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
11
|
+
Autonomous headless run: no user exists. Never ask questions, propose plans
|
|
12
|
+
for approval, or end the turn waiting — decide and proceed. Standing
|
|
13
|
+
pre-approval covers every action: edits, state mutation, delegation, builds.
|
|
14
|
+
Loop until the task is verified complete or provably blocked.
|
|
15
|
+
|
|
16
|
+
The pipeline has exactly three stages. Lead directs and verifies it, but NEVER
|
|
17
|
+
executes the work itself: no edits, answers, or artifact generation, regardless
|
|
18
|
+
of task size, perceived simplicity, or number of steps.
|
|
19
|
+
|
|
20
|
+
## 1. Lead analysis and direction
|
|
21
|
+
Lead performs real analysis first on EVERY task: task structure, required
|
|
22
|
+
deliverables, boundaries, the task's own verification means, and solution
|
|
23
|
+
direction. Convert it into clear execution direction and delegation briefs
|
|
24
|
+
following the Lead brief contract.
|
|
25
|
+
|
|
26
|
+
Hand the direction and briefs to executors. Analysis is not permission for
|
|
27
|
+
Lead to implement any portion of the result: all edits, answer production, and
|
|
28
|
+
artifact generation belong to executor sessions.
|
|
29
|
+
|
|
30
|
+
## 2. Executors perform the work
|
|
31
|
+
Use Worker sessions, or Heavy Worker sessions for broad scopes, to execute the
|
|
32
|
+
directed work. Multiple workers MAY fan out in parallel, one per independent
|
|
33
|
+
scope. Keep ownership clear for each assigned deliverable.
|
|
34
|
+
|
|
35
|
+
Executors build the answer or artifact and perform basic does-it-run checks.
|
|
36
|
+
They are not a verification role and do not own acceptance, requirements
|
|
37
|
+
judgment, or final correctness. Each executor reports its result to Lead.
|
|
38
|
+
|
|
39
|
+
## 3. Lead and Reviewer verify
|
|
40
|
+
|
|
41
|
+
When executors report, Lead and Reviewer start cross-verification IN PARALLEL,
|
|
42
|
+
never serially. Lead personally runs the task's own verification means, such
|
|
43
|
+
as its test suite, grader script, simulator, or self-checkable output.
|
|
44
|
+
Reviewer independently judges the result against every task requirement,
|
|
45
|
+
including intent, correctness, boundaries, and deliverables.
|
|
46
|
+
|
|
47
|
+
Judgment-type answers with no direct ground truth still require parallel
|
|
48
|
+
cross-verification, even for a single small deliverable. Lead evaluates against
|
|
49
|
+
available criteria while Reviewer independently judges requirements;
|
|
50
|
+
perceived simplicity is no exemption.
|
|
51
|
+
|
|
52
|
+
Merge any finding into a clear fix delta and return it to the SAME executor
|
|
53
|
+
session owning the affected scope. The executor applies it and reports again.
|
|
54
|
+
Lead and Reviewer repeat the same parallel cross-verification until both legs
|
|
55
|
+
are clean; Lead never fixes or completes the work directly.
|
|
56
|
+
|
|
57
|
+
Before declaring completion, Lead personally runs the task-required
|
|
58
|
+
verification one final time and checks that every deliverable is present.
|
|
59
|
+
Never end with a question, approval request, or proposed next step. Continue
|
|
60
|
+
until verified complete or stop only when completion is provably blocked.
|
|
@@ -13,33 +13,38 @@ Approval is a later explicit user message after the latest plan ("do it",
|
|
|
13
13
|
approval with a scope change needs a revised plan and fresh approval. Before
|
|
14
14
|
approval: no edits, state mutation, or delegation.
|
|
15
15
|
|
|
16
|
-
Lead
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
Lead orchestrates and verifies. Lead-direct work is allowed only for pure
|
|
17
|
+
read/analysis, git/configuration, or when the user explicitly supplies both the
|
|
18
|
+
exact target and exact replacement/output. Never infer an exemption from a task
|
|
19
|
+
name, file count, or perceived difficulty. Every other implementation, reverse
|
|
20
|
+
engineering, debugging application, or artifact generation delegates to the
|
|
21
|
+
matching agent. Debugger owns diagnosis and reverse engineering; Worker applies
|
|
22
|
+
an established bounded change or fully specified artifact; Heavy Worker owns
|
|
23
|
+
implementation that must establish the change through investigation or staged
|
|
24
|
+
delivery. Applying a Debugger result is implementation, not diagnosis.
|
|
25
25
|
|
|
26
26
|
1. Plan: draft before any implementation; settle scope/plan, ask if ambiguous,
|
|
27
27
|
then await the gate.
|
|
28
|
-
2. Delegate:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
Reviewer + Lead
|
|
41
|
-
|
|
42
|
-
work
|
|
28
|
+
2. Delegate: one agent per ready independent scope; spawn all ready scopes in
|
|
29
|
+
one turn, with no count cap. Serialize only a real dependency, overlapping
|
|
30
|
+
write, or inseparable coupling. Briefs follow the Lead brief contract.
|
|
31
|
+
After async spawn, end the turn.
|
|
32
|
+
3. Review: review is exempt only for pure read/analysis with no edit, artifact,
|
|
33
|
+
or state mutation; git/configuration; or a request where the user explicitly
|
|
34
|
+
supplies both the exact target and exact replacement/output. Every
|
|
35
|
+
non-exempt mutation or artifact, whether produced or applied by Worker,
|
|
36
|
+
Heavy Worker, Debugger, or Lead, gets one Reviewer (all ready reviewers in
|
|
37
|
+
one turn) and Lead
|
|
38
|
+
integration/cross-scope verification in parallel. Debugger analysis cannot
|
|
39
|
+
substitute for implementation review: applying a Debugger result triggers
|
|
40
|
+
the same Reviewer + Lead verification. Reviewer independently judges risk,
|
|
41
|
+
intent, boundaries; Lead checks acceptance/interactions, not duplicate
|
|
42
|
+
same-scope work. High-risk scopes add distinct lenses. Synthesize one
|
|
43
|
+
verdict; send merged fixes to the original live session; loop fix ->
|
|
44
|
+
re-verify (same Reviewer + Lead re-check) until clean. Debugger first for
|
|
45
|
+
requested debugging or a bug surviving 2+ fix cycles. Exempt mutations still
|
|
46
|
+
require shell self-verification before report. Agent reports relay scope,
|
|
47
|
+
verdict, next work as in-progress, never conclusions.
|
|
43
48
|
4. Report: final (not interim) report compares work to approved plan and gives
|
|
44
49
|
verified result; never forward raw agent output. Ask about ship/deploy when
|
|
45
50
|
relevant. Build/deploy/commit/push require an explicit user request after
|