mixdog 0.9.51 → 0.9.53
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 +5 -3
- package/scripts/abort-recovery-test.mjs +17 -1
- package/scripts/agent-model-liveness-test.mjs +79 -2
- package/scripts/anthropic-admission-retry-integration-test.mjs +119 -0
- package/scripts/anthropic-transport-policy-test.mjs +466 -0
- package/scripts/atomic-lock-tryonce-test.mjs +60 -1
- package/scripts/bench-run.mjs +2 -2
- package/scripts/build-tui.mjs +13 -1
- package/scripts/channel-daemon-smoke.mjs +630 -10
- package/scripts/code-graph-aggregate-cwd-test.mjs +41 -37
- package/scripts/code-graph-disk-hit-test.mjs +11 -0
- package/scripts/code-graph-root-federation-test.mjs +273 -0
- package/scripts/compact-pressure-test.mjs +159 -1
- package/scripts/compact-smoke.mjs +80 -0
- package/scripts/context-mcp-metering-test.mjs +1350 -19
- package/scripts/deferred-tool-loading-test.mjs +17 -0
- package/scripts/desktop-session-bridge-test.mjs +704 -0
- package/scripts/freevar-smoke.mjs +7 -4
- package/scripts/gemini-provider-test.mjs +1053 -0
- package/scripts/interrupted-turn-history-test.mjs +371 -0
- package/scripts/lifecycle-api-test.mjs +137 -0
- package/scripts/max-output-recovery-test.mjs +86 -0
- package/scripts/mcp-grace-deferred-test.mjs +89 -13
- package/scripts/memory-core-input-test.mjs +10 -0
- package/scripts/memory-pg-recovery-test.mjs +59 -0
- package/scripts/openai-oauth-ws-1006-retry-test.mjs +387 -6
- package/scripts/openai-ws-early-settle-test.mjs +40 -0
- package/scripts/parent-abort-link-test.mjs +24 -0
- package/scripts/process-lifecycle-test.mjs +447 -0
- package/scripts/provider-admission-scheduler-test.mjs +582 -0
- package/scripts/provider-contract-test.mjs +525 -0
- package/scripts/provider-toolcall-test.mjs +492 -11
- package/scripts/reactive-compact-persist-smoke.mjs +59 -0
- package/scripts/resource-admission-test.mjs +789 -0
- package/scripts/session-orphan-sweep-test.mjs +27 -1
- package/scripts/shell-jobs-windows-hide-test.mjs +1 -1
- package/scripts/steering-drain-buckets-test.mjs +18 -0
- package/scripts/toolcall-args-test.mjs +14 -6
- package/scripts/tui-transcript-perf-test.mjs +5 -7
- package/src/cli.mjs +15 -2
- package/src/lib/keychain-cjs.cjs +36 -23
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch.mjs +27 -13
- package/src/runtime/agent/orchestrator/agent-runtime/agent-progress-watchdog.mjs +4 -1
- package/src/runtime/agent/orchestrator/agent-runtime/cache-strategy.mjs +7 -8
- package/src/runtime/agent/orchestrator/agent-trace.mjs +33 -9
- package/src/runtime/agent/orchestrator/providers/admission-scheduler.mjs +331 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-effort.mjs +7 -2
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth.mjs +114 -308
- package/src/runtime/agent/orchestrator/providers/anthropic-sse.mjs +31 -21
- package/src/runtime/agent/orchestrator/providers/anthropic.mjs +136 -286
- package/src/runtime/agent/orchestrator/providers/gemini-cache.mjs +42 -5
- package/src/runtime/agent/orchestrator/providers/gemini-schema.mjs +554 -42
- package/src/runtime/agent/orchestrator/providers/gemini-stream.mjs +67 -18
- package/src/runtime/agent/orchestrator/providers/gemini.mjs +84 -150
- package/src/runtime/agent/orchestrator/providers/grok-oauth.mjs +17 -119
- package/src/runtime/agent/orchestrator/providers/lib/anthropic-request-utils.mjs +224 -0
- package/src/runtime/agent/orchestrator/providers/lib/env-utils.mjs +6 -0
- package/src/runtime/agent/orchestrator/providers/lib/gemini-model-catalog.mjs +119 -0
- package/src/runtime/agent/orchestrator/providers/lib/grok-tool-schema.mjs +109 -0
- package/src/runtime/agent/orchestrator/providers/lib/openai-tool-args.mjs +70 -0
- package/src/runtime/agent/orchestrator/providers/model-catalog.mjs +54 -14
- package/src/runtime/agent/orchestrator/providers/openai-compat-presets.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/openai-compat-stream.mjs +28 -74
- package/src/runtime/agent/orchestrator/providers/openai-compat-xai.mjs +10 -80
- package/src/runtime/agent/orchestrator/providers/openai-compat.mjs +136 -20
- package/src/runtime/agent/orchestrator/providers/openai-oauth-http-sse.mjs +94 -33
- package/src/runtime/agent/orchestrator/providers/openai-oauth-ws.mjs +201 -123
- package/src/runtime/agent/orchestrator/providers/openai-oauth.mjs +37 -28
- package/src/runtime/agent/orchestrator/providers/openai-ws-delta.mjs +10 -10
- package/src/runtime/agent/orchestrator/providers/openai-ws-events.mjs +30 -3
- package/src/runtime/agent/orchestrator/providers/openai-ws-pool.mjs +36 -3
- package/src/runtime/agent/orchestrator/providers/openai-ws-stream.mjs +50 -45
- package/src/runtime/agent/orchestrator/providers/openai-ws.mjs +78 -12
- package/src/runtime/agent/orchestrator/providers/opencode-go.mjs +44 -5
- package/src/runtime/agent/orchestrator/providers/registry.mjs +49 -8
- package/src/runtime/agent/orchestrator/providers/retry-classifier.mjs +229 -111
- package/src/runtime/agent/orchestrator/session/agent-loop.mjs +130 -63
- package/src/runtime/agent/orchestrator/session/compact/engine.mjs +99 -32
- package/src/runtime/agent/orchestrator/session/context-compaction-policy.mjs +170 -0
- package/src/runtime/agent/orchestrator/session/context-utils.mjs +37 -224
- package/src/runtime/agent/orchestrator/session/loop/compact-policy.mjs +11 -17
- package/src/runtime/agent/orchestrator/session/manager/ask-session.mjs +81 -42
- package/src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs +10 -1
- package/src/runtime/agent/orchestrator/session/manager/idle-cleanup.mjs +21 -5
- package/src/runtime/agent/orchestrator/session/manager/message-sanitize.mjs +8 -28
- package/src/runtime/agent/orchestrator/session/manager/prefetch-bridge.mjs +3 -58
- package/src/runtime/agent/orchestrator/session/manager/runtime-liveness.mjs +30 -7
- package/src/runtime/agent/orchestrator/session/manager/session-close.mjs +2 -0
- package/src/runtime/agent/orchestrator/session/manager/session-crud.mjs +10 -1
- package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.mjs +42 -1
- package/src/runtime/agent/orchestrator/session/manager/turn-interruption.mjs +220 -0
- package/src/runtime/agent/orchestrator/session/manager/usage-metrics.mjs +57 -16
- package/src/runtime/agent/orchestrator/session/pre-send-compact.mjs +20 -4
- package/src/runtime/agent/orchestrator/session/save-session-worker.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/send-with-recovery.mjs +12 -1
- package/src/runtime/agent/orchestrator/session/store/paths-heartbeat.mjs +52 -0
- package/src/runtime/agent/orchestrator/session/store/write-guards.mjs +62 -0
- package/src/runtime/agent/orchestrator/session/store-summary-index.mjs +17 -0
- package/src/runtime/agent/orchestrator/session/store.mjs +353 -108
- package/src/runtime/agent/orchestrator/stall-policy.mjs +2 -12
- package/src/runtime/agent/orchestrator/tools/bash-session.mjs +42 -4
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs +74 -37
- package/src/runtime/agent/orchestrator/tools/builtin/lib/list-helpers.mjs +46 -0
- package/src/runtime/agent/orchestrator/tools/builtin/lib/search-grep-chunks.mjs +173 -0
- package/src/runtime/agent/orchestrator/tools/builtin/lib/search-input-helpers.mjs +117 -0
- package/src/runtime/agent/orchestrator/tools/builtin/lib/shell-job-insights.mjs +199 -0
- package/src/runtime/agent/orchestrator/tools/builtin/lib/shell-spawn-helpers.mjs +107 -0
- package/src/runtime/agent/orchestrator/tools/builtin/list-tool.mjs +1 -40
- package/src/runtime/agent/orchestrator/tools/builtin/search-tool.mjs +19 -277
- package/src/runtime/agent/orchestrator/tools/builtin/shell-job-process.mjs +223 -2
- package/src/runtime/agent/orchestrator/tools/builtin/shell-jobs.mjs +317 -250
- package/src/runtime/agent/orchestrator/tools/code-graph/build.mjs +176 -21
- package/src/runtime/agent/orchestrator/tools/code-graph/disk-cache.mjs +14 -0
- package/src/runtime/agent/orchestrator/tools/code-graph/dispatch.mjs +108 -2
- package/src/runtime/agent/orchestrator/tools/code-graph/trusted-roots.mjs +93 -0
- package/src/runtime/agent/orchestrator/tools/code-graph-prewarm-worker.mjs +12 -3
- package/src/runtime/agent/orchestrator/tools/lib/shell-spawn-retry.mjs +67 -0
- package/src/runtime/agent/orchestrator/tools/shell-command.mjs +125 -85
- package/src/runtime/channels/backends/discord-gateway.mjs +1 -1
- package/src/runtime/channels/backends/discord.mjs +6 -6
- package/src/runtime/channels/lib/config.mjs +15 -2
- package/src/runtime/channels/lib/memory-client.mjs +20 -3
- package/src/runtime/channels/lib/owned-runtime.mjs +19 -12
- package/src/runtime/channels/lib/status-snapshot.mjs +9 -0
- package/src/runtime/channels/lib/tool-dispatch.mjs +9 -5
- package/src/runtime/channels/lib/worker-main.mjs +16 -5
- package/src/runtime/memory/index.mjs +46 -202
- package/src/runtime/memory/lib/memory-action-handlers.mjs +2 -53
- package/src/runtime/memory/lib/memory-daemon-lifecycle.mjs +115 -0
- package/src/runtime/memory/lib/memory-port-advertiser.mjs +105 -0
- package/src/runtime/memory/lib/pg/adapter.mjs +84 -10
- package/src/runtime/memory/lib/pg/process.mjs +91 -47
- package/src/runtime/memory/lib/pg/supervisor.mjs +50 -17
- package/src/runtime/memory/lib/query-handlers.mjs +2 -122
- package/src/runtime/memory/lib/query-maintenance-handlers.mjs +126 -0
- package/src/runtime/memory/lib/tool-call-handler.mjs +57 -0
- package/src/runtime/search/lib/http-fetch.mjs +1 -1
- package/src/runtime/shared/atomic-file.mjs +28 -150
- package/src/runtime/shared/config.mjs +58 -13
- package/src/runtime/shared/llm/cost.mjs +14 -4
- package/src/runtime/shared/memory-snapshot.mjs +236 -0
- package/src/runtime/shared/process-lifecycle.mjs +436 -0
- package/src/runtime/shared/process-shutdown.mjs +33 -4
- package/src/runtime/shared/resource-admission.mjs +364 -0
- package/src/runtime/shared/staged-child-result.mjs +19 -0
- package/src/session-runtime/channel-config-api.mjs +7 -7
- package/src/session-runtime/config-lifecycle.mjs +20 -17
- package/src/session-runtime/context-status.mjs +38 -27
- package/src/session-runtime/cwd-plugins.mjs +9 -7
- package/src/session-runtime/env.mjs +1 -2
- package/src/session-runtime/hitch-profile.mjs +45 -0
- package/src/session-runtime/lifecycle-api.mjs +60 -13
- package/src/session-runtime/mcp-glue.mjs +6 -11
- package/src/session-runtime/provider-init-key.mjs +17 -0
- package/src/session-runtime/provider-request-tools.mjs +72 -0
- package/src/session-runtime/runtime-core.mjs +49 -105
- package/src/session-runtime/runtime-paths.mjs +20 -0
- package/src/session-runtime/runtime-tool-routing.mjs +55 -0
- package/src/session-runtime/session-turn-api.mjs +5 -4
- package/src/session-runtime/tool-catalog-data.mjs +51 -0
- package/src/session-runtime/tool-catalog.mjs +390 -104
- package/src/standalone/agent-tool/spawn-preset.mjs +73 -0
- package/src/standalone/agent-tool/worker-rows.mjs +93 -0
- package/src/standalone/agent-tool.mjs +29 -200
- package/src/standalone/channel-admin.mjs +29 -0
- package/src/standalone/channel-daemon-client.mjs +200 -38
- package/src/standalone/channel-daemon-transport.mjs +136 -9
- package/src/standalone/channel-worker.mjs +79 -12
- package/src/tui/App.jsx +11 -5
- package/src/tui/dist/index.mjs +275 -343
- package/src/tui/engine/session-api-ext.mjs +50 -6
- package/src/tui/engine/session-api.mjs +1 -1
- package/src/tui/engine/turn.mjs +10 -6
- package/src/tui/engine.mjs +13 -4
- package/src/tui/index.jsx +5 -1
- package/src/tui/lib/voice-setup.mjs +21 -5
- package/scripts/_devtools-stub.mjs +0 -1
- package/src/runtime/lib/keychain-cjs.cjs +0 -288
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { semanticCompactMessages, recallFastTrackCompactMessages, SUMMARY_PREFIX, COMPACT_TYPE_SEMANTIC, COMPACT_TYPE_RECALL_FASTTRACK, normalizeCompactType } from '../src/runtime/agent/orchestrator/session/compact.mjs';
|
|
3
3
|
import { agentLoop } from '../src/runtime/agent/orchestrator/session/loop.mjs';
|
|
4
4
|
import { estimateMessagesTokens, estimateToolSchemaTokens } from '../src/runtime/agent/orchestrator/session/context-utils.mjs';
|
|
5
|
+
import { runSessionCompaction } from '../src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs';
|
|
5
6
|
import { autoCompactWindowForRoute, summarizeGatewayUsage } from '../src/vendor/statusline/src/gateway/route-meta.mjs';
|
|
6
7
|
|
|
7
8
|
function assert(condition, message) {
|
|
@@ -104,6 +105,85 @@ const wholeTranscriptForced = await semanticCompactMessages(wholeTranscriptProvi
|
|
|
104
105
|
assert(wholeTranscriptForced.semantic === true && wholeTranscriptForcedCalls === 1, 'forced semantic compact must summarize when tail budget would preserve the whole live transcript (default tailTurns)');
|
|
105
106
|
assert(findSummary(wholeTranscriptForced.messages), 'whole-transcript forced semantic compact should insert an anchored summary');
|
|
106
107
|
|
|
108
|
+
// Manual /compact must reduce the active session transcript directly through
|
|
109
|
+
// semantic compaction even when main-session policy is recall-fasttrack. If the
|
|
110
|
+
// override regresses, this test enters Memory first (unregistered in this smoke)
|
|
111
|
+
// and reports recall-fasttrack metadata before falling back.
|
|
112
|
+
let manualDirectCalls = 0;
|
|
113
|
+
let manualDirectPrompt = '';
|
|
114
|
+
const manualDirectMessages = [
|
|
115
|
+
{ role: 'system', content: 'MANUAL_SYSTEM_RULE_STAYS_EXACT' },
|
|
116
|
+
{
|
|
117
|
+
role: 'user',
|
|
118
|
+
content: '# Session\nCwd: C:\\Injected\\Noise\nModel: fake-model\nWorkflow: Solo\n\n# Additional context\nOLD_ADDITIONAL_CONTEXT_INJECTION\n\n# Prefetch\nOLD_PREFETCH_INJECTION\n\n# Task\nREAL_OLD_USER_REQUEST\n<system-reminder>OLD_SYSTEM_REMINDER_INJECTION</system-reminder>\n<memory-context>OLD_MEMORY_CONTEXT_INJECTION</memory-context>',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
role: 'assistant',
|
|
122
|
+
content: 'REAL_OLD_ASSISTANT_REPLY\n```text\nOLD_CODE_FENCE_TRACE\n```',
|
|
123
|
+
toolCalls: [{ id: 'OLD_TOOL_CALL_ID', name: 'OLD_TOOL_CALL_TRACE', arguments: '{"password":"OLD_TOOL_SECRET"}' }],
|
|
124
|
+
},
|
|
125
|
+
{ role: 'tool', toolCallId: 'OLD_TOOL_CALL_ID', content: 'OLD_TOOL_RESULT_TRACE' },
|
|
126
|
+
{ role: 'developer', content: 'OLD_DEVELOPER_INJECTION' },
|
|
127
|
+
{ role: 'user', content: 'Reference files:\nOLD_REFERENCE_FILE_INJECTION' },
|
|
128
|
+
{ role: 'user', content: '[mixdog-runtime] OLD_RUNTIME_INJECTION' },
|
|
129
|
+
{ role: 'user', content: 'CURRENT_REQUEST_STAYS_VERBATIM' },
|
|
130
|
+
{ role: 'assistant', content: 'CURRENT_ASSISTANT_STAYS_VERBATIM' },
|
|
131
|
+
];
|
|
132
|
+
const manualDirectSession = {
|
|
133
|
+
id: `compact-smoke-manual-direct-${process.pid}`,
|
|
134
|
+
provider: 'manual-direct-smoke',
|
|
135
|
+
model: 'fake-model',
|
|
136
|
+
contextWindow: 100_000,
|
|
137
|
+
compactBoundaryTokens: 100_000,
|
|
138
|
+
messages: manualDirectMessages.map((m) => ({ ...m })),
|
|
139
|
+
tools: [],
|
|
140
|
+
compaction: {
|
|
141
|
+
type: COMPACT_TYPE_RECALL_FASTTRACK,
|
|
142
|
+
compactType: COMPACT_TYPE_RECALL_FASTTRACK,
|
|
143
|
+
tailTurns: 1,
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
const manualDirect = await runSessionCompaction(manualDirectSession, {
|
|
147
|
+
mode: 'manual',
|
|
148
|
+
force: true,
|
|
149
|
+
compactType: COMPACT_TYPE_SEMANTIC,
|
|
150
|
+
filterOldHistoryForIngest: true,
|
|
151
|
+
provider: {
|
|
152
|
+
name: 'manual-direct-smoke',
|
|
153
|
+
async send(sentMessages) {
|
|
154
|
+
manualDirectCalls += 1;
|
|
155
|
+
manualDirectPrompt = sentMessages.map((m) => String(m?.content || '')).join('\n');
|
|
156
|
+
return { content: '## Goal\n- compact only the active session\n\n## Constraints & Preferences\n- preserve the recent tail\n\n## Progress\n### Done\n- reduced old transcript content\n\n### In Progress\n- (none)\n\n### Blocked\n- (none)\n\n## Key Decisions\n- use direct semantic compaction\n\n## Next Steps\n- continue from the preserved tail\n\n## Critical Context\n- active session only\n\n## Relevant Files\n- session-crud.mjs' };
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
model: 'fake-model',
|
|
160
|
+
});
|
|
161
|
+
assert(manualDirectCalls === 1, 'manual direct compact should make exactly one semantic provider call');
|
|
162
|
+
assert(manualDirect.compactType === COMPACT_TYPE_SEMANTIC, 'manual direct compact must bypass recall-fasttrack policy');
|
|
163
|
+
assert(manualDirect.semanticCompact === true, 'manual direct compact should produce a semantic summary');
|
|
164
|
+
assert(manualDirect.recallFastTrackError == null, 'manual direct compact must not touch Memory recall');
|
|
165
|
+
assert(findSummary(manualDirectSession.messages), 'manual direct compact should replace old active-session history with a handoff summary');
|
|
166
|
+
assert(manualDirectPrompt.includes('REAL_OLD_USER_REQUEST'), 'manual compact prompt should retain genuine old user prose');
|
|
167
|
+
assert(manualDirectPrompt.includes('REAL_OLD_ASSISTANT_REPLY'), 'manual compact prompt should retain genuine old assistant prose');
|
|
168
|
+
for (const excluded of [
|
|
169
|
+
'OLD_ADDITIONAL_CONTEXT_INJECTION',
|
|
170
|
+
'OLD_PREFETCH_INJECTION',
|
|
171
|
+
'OLD_SYSTEM_REMINDER_INJECTION',
|
|
172
|
+
'OLD_MEMORY_CONTEXT_INJECTION',
|
|
173
|
+
'OLD_CODE_FENCE_TRACE',
|
|
174
|
+
'OLD_TOOL_CALL_TRACE',
|
|
175
|
+
'OLD_TOOL_SECRET',
|
|
176
|
+
'OLD_TOOL_RESULT_TRACE',
|
|
177
|
+
'OLD_DEVELOPER_INJECTION',
|
|
178
|
+
'OLD_REFERENCE_FILE_INJECTION',
|
|
179
|
+
'OLD_RUNTIME_INJECTION',
|
|
180
|
+
]) {
|
|
181
|
+
assert(!manualDirectPrompt.includes(excluded), `manual compact old-history filter must exclude ${excluded}`);
|
|
182
|
+
}
|
|
183
|
+
assert(manualDirectSession.messages.some((m) => m.role === 'system' && m.content === 'MANUAL_SYSTEM_RULE_STAYS_EXACT'), 'manual compact must preserve system rules separately');
|
|
184
|
+
assert(manualDirectSession.messages.some((m) => m.role === 'user' && m.content === 'CURRENT_REQUEST_STAYS_VERBATIM'), 'manual compact must preserve the recent user turn verbatim');
|
|
185
|
+
assert(manualDirectSession.messages.some((m) => m.role === 'assistant' && m.content === 'CURRENT_ASSISTANT_STAYS_VERBATIM'), 'manual compact must preserve the recent assistant turn verbatim');
|
|
186
|
+
|
|
107
187
|
assert(normalizeCompactType('type1') === COMPACT_TYPE_SEMANTIC, 'type1 should resolve to semantic compact');
|
|
108
188
|
assert(normalizeCompactType('recall-fasttrack') === COMPACT_TYPE_RECALL_FASTTRACK, 'type2 should resolve to recall fast-track compact');
|
|
109
189
|
// Alias parity: snake_case + dash + no-dash spellings of fast-track must all
|