@adhdev/daemon-core 0.9.82-rc.507 → 0.9.82-rc.508
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/dist/index.js +43 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +43 -7
- package/dist/index.mjs.map +1 -1
- package/dist/mesh/model-provider-compat.d.ts +44 -0
- package/package.json +3 -3
- package/src/mesh/coordinator-prompt.ts +7 -2
- package/src/mesh/mesh-queue-assignment.ts +20 -1
- package/src/mesh/model-provider-compat.ts +73 -0
package/dist/index.js
CHANGED
|
@@ -417,10 +417,10 @@ function readInjected(value) {
|
|
|
417
417
|
}
|
|
418
418
|
function getDaemonBuildInfo() {
|
|
419
419
|
if (cached) return cached;
|
|
420
|
-
const commit = readInjected(true ? "
|
|
421
|
-
const commitShort = readInjected(true ? "
|
|
422
|
-
const version = readInjected(true ? "0.9.82-rc.
|
|
423
|
-
const builtAt = readInjected(true ? "2026-07-
|
|
420
|
+
const commit = readInjected(true ? "3c72ac19ec9253071d614cd2410dc9f8d555eb26" : void 0) ?? "unknown";
|
|
421
|
+
const commitShort = readInjected(true ? "3c72ac19" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
422
|
+
const version = readInjected(true ? "0.9.82-rc.508" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
423
|
+
const builtAt = readInjected(true ? "2026-07-12T23:18:59.856Z" : void 0);
|
|
424
424
|
cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
|
|
425
425
|
return cached;
|
|
426
426
|
}
|
|
@@ -3925,7 +3925,7 @@ function buildRulesSection(coordinatorCliType) {
|
|
|
3925
3925
|
|
|
3926
3926
|
- **Route, don't implement.** Delegate all code reading, analysis, and execution to node agents. Never read source files or run commands in the coordinator \u2014 keep context lean.
|
|
3927
3927
|
- **Front-load task messages.** Include everything the agent needs (files, problem, expected fix) in \`mesh_enqueue_task\` / \`mesh_send_task\`. Append a structured result request at the end: ask the worker to conclude with a JSON block containing \`status\`, \`changedFiles\`, \`gitStatus\`, \`validationResults\`, \`errors\`, \`nextAction\`. The daemon parses this automatically; you can read it from \`mesh_task_history\`.
|
|
3928
|
-
- **Reuse idle sessions.** For follow-up, retry, commit/push, or cleanup on the same issue, send only the delta to the existing idle session. Start fresh only
|
|
3928
|
+
- **Reuse idle sessions.** For follow-up, retry, commit/push, or cleanup on the same issue, send only the delta to the existing idle session. Start a fresh session only when: (a) branch/worktree isolation is required, (b) the existing session had a dispatch failure or provider mismatch, (c) the transcript/runtime is contaminated or interrupted, or (d) the user explicitly asks for a different provider/session. Continuation of the same issue in an already-idle session is allowed and preferred \u2014 this rule blocks concurrent unrelated work interleaved into a live (still-generating) session, not sequential same-issue follow-ups.
|
|
3929
3929
|
- **Worktree affinity.** A worktree is a durable per-branch workspace; keep all of a branch's code_change/fix/review work on its worktree node by targeting \`required_tags: ["worktree=<branch>"]\` or \`target_node_id\`. Get the id/branch from the \`mesh_clone_node\` result or a live \`mesh_status\` \u2014 the Configured Nodes snapshot won't list a worktree cloned after launch. Untargeted same-branch follow-ups drift to the base node. Only \`convergence\` (merge/push) runs on the base, never pinned to the worktree.
|
|
3930
3930
|
- **Classify task difficulty to save tokens.** For each task you enqueue, judge its execution difficulty and pass \`difficulty\`: \`easy\` (extraction, renames, doc tweaks, trivial fixes), \`medium\` (ordinary feature/bugfix work), \`difficult\` (architecture, tricky debugging, multi-file refactors, subtle reasoning), or \`freeform\`. The mesh's per-difficulty brain preset then runs easy tasks on a cheaper model at low reasoning effort and hard tasks on a stronger model at high effort \u2014 real token savings on simple work. The current presets are shown in the "Brain presets" section below. You may still pass an explicit \`model\`/\`thinkingLevel\` to override the preset for one task.
|
|
3931
3931
|
- **Retune node profiles when routing is a poor fit \u2014 but only with approval.** A node's capability slots (its provider/model/thinking + difficulty range + capability tags, seen via \`mesh_node_slots_list\`) are what task\u2192node fitness routing matches against. If you notice a persistent mismatch \u2014 e.g. every \`difficult\` task lands on a node whose only slot is a cheap model, or a capability a node clearly has isn't declared \u2014 you MAY propose a slot change with \`mesh_node_slots_set\` (write=false). That returns current-vs-proposed; present that diff to the user with a one-line reason and apply (write=true) ONLY after they approve. It is a WHOLESALE replacement of the node's slots, so include the slots you want to keep. Never rewrite a node's profile silently or without a clear routing reason.
|
|
@@ -3933,12 +3933,15 @@ function buildRulesSection(coordinatorCliType) {
|
|
|
3933
3933
|
- **Verify via git, not source.** Use \`mesh_git_status\` to confirm side effects. Treat agent summaries as self-reports, not verification.
|
|
3934
3934
|
- **Limit parallelism.** Start with 1\u20132 tasks; scale only on success. Never duplicate a session because \`mesh_read_chat\` shows no final message while tool/terminal activity is ongoing. This caps *concurrent* load \u2014 it does not mean serialize independent work: when a new, independent request arrives and there is headroom under \`maxParallelTasks\`, dispatch it right away rather than waiting for an in-flight task or a user nudge (read-only diagnosis especially, since it has no merge cost).
|
|
3935
3935
|
- **Check history first.** Call \`mesh_task_history\` at session start to avoid duplicate work and inform recovery. On failure, read task history before retrying.
|
|
3936
|
+
- **Don't reopen already-done work after a resume.** Before reopening a reported issue after context compaction or session resume, check current git state and recent session context. If another session has already completed the work, continue from the existing diff/commit instead of starting a duplicate investigation.
|
|
3936
3937
|
- **Sequence shared-base-moving merges.** Parallel dispatch is encouraged, but merging one worktree can advance another in-flight worktree's base \u2014 especially a shared submodule pointer \u2014 turning a clean fast-forward into a diverged rebase (patch-equivalence correctly blocks this). Before merging an in-flight worktree while siblings are also in flight, land in an intentional order, re-clone long-running worktrees from the advanced base, or expect to manually rebase + ff-only the laggards; merging an independent fix mid-flight can strand siblings into a rebase.
|
|
3937
3938
|
- **Converge branches.** After worktree tasks: refine/fast-forward, or classify as \`pushed_feature_branch_needs_merge\` / \`blocked_review\` / \`cleanup_candidate\` / \`not_mergeable\`. Clean up with \`mesh_remove_node\`.
|
|
3938
3939
|
- **Refinery is config-driven.** \`mesh_refine_node\` must run validation from \`.adhdev/refine.{json,yaml,yml}\` or \`repo-mesh.refine.*\`. Heuristics are scaffolding only.
|
|
3939
3940
|
- **Submodule reachability = publish-needed.** \`submodule_reachability_failed\` \u2192 classify as \`blocked_review\`, request user approval to push to submodule main, then rerun \`mesh_refine_node\`.
|
|
3940
3941
|
- **Honor per-node instructions.** When a node carries a \u{1F4CC} Node instruction in the nodes section, include the relevant parts of that instruction in the task message you send to that node. Don't paraphrase the instruction into your own words \u2014 quote it verbatim so the worker agent sees exactly what the user wrote.
|
|
3941
3942
|
- **Mission status does not update itself.** When a mission's tasks are all done or the work is abandoned, explicitly call \`mesh_mission_upsert\` to set status \`completed\` or \`abandoned\`. Never leave a finished mission in \`active\`. All-cancelled tasks with no further work \u2192 \`abandoned\`.
|
|
3943
|
+
- **Don't spawn a nested coordinator for simple inspection.** Do not spawn a nested coordinator-like agent for simple inspection tasks. If delegation is required, use explicit provider selection and a fully self-contained, bounded task instruction.
|
|
3944
|
+
- **Keep internal traffic out of the transcript.** Internal tool calls, status events, control messages, and debug output must not appear as ordinary user-visible chat transcript content unless explicitly marked user-facing by the producing agent.
|
|
3942
3945
|
- **Never fabricate tool results.** Always call the actual tool.
|
|
3943
3946
|
- **Keep the user informed.** One or two sentences after each delegation round.${coordinatorNote}
|
|
3944
3947
|
|
|
@@ -4043,7 +4046,9 @@ Follow these recovery rules:
|
|
|
4043
4046
|
1. **If "Retry recommended"**: Check \`mesh_view_queue\` first \u2014 the daemon may have auto-requeued. If not, re-launch the session on the same node (\`mesh_launch_session\`), then resend the original task (\`mesh_send_task\`). The system message includes the original task text.
|
|
4044
4047
|
2. **If "Max retries exceeded"**: Do NOT retry on the same node. Either reassign the task to a different node, or inform the user that the task requires manual intervention.
|
|
4045
4048
|
3. **If no recovery context**: The stop may be intentional (normal completion). Use \`mesh_read_chat\` once to verify, then move on.
|
|
4046
|
-
4. **Always record what happened**: After handling a failure, briefly note the outcome in your report to the user
|
|
4049
|
+
4. **Always record what happened**: After handling a failure, briefly note the outcome in your report to the user.
|
|
4050
|
+
5. **Stuck-but-done vs actually-stuck**: If a delegated session appears stuck but has already produced a verified final summary or diff, stop polling noisy tool/terminal transcript bubbles. Verify with \`mesh_git_status\` or a checkpoint and proceed to landing.
|
|
4051
|
+
6. **Refinery falsely blocks a verified-clean branch \u2014 manual fast-forward convergence**: When \`mesh_refine_node\` falsely blocks a verified-clean branch (stale preflight, or the submodule-gitlink trivial-fast-forward misjudgment), bypass the refine tool and converge by strict fast-forward \u2014 (1) rebase the submodule commit onto the submodule \`origin/main\`, (2) push the submodule ff-only (verify \`git merge-base --is-ancestor\` first), (3) rebase the root branch and re-bump the submodule pointer so the root diff stays non-empty, (4) push the root ff-only. NEVER force-push or reset; abort and report on any non-fast-forward.`;
|
|
4047
4052
|
ONBOARDING_SECTION = `## Onboarding / Reinit
|
|
4048
4053
|
|
|
4049
4054
|
When the user asks to **set up / configure / onboard** this repo for Repo Mesh (or to **re-init / reconfigure** an already-onboarded repo), run ONE guided, approval-gated conversation. You draft, the user approves, the daemon writes. Never auto-write a heuristic suggestion without an explicit user approval turn.
|
|
@@ -15568,6 +15573,32 @@ var init_mesh_clone_grace = __esm({
|
|
|
15568
15573
|
}
|
|
15569
15574
|
});
|
|
15570
15575
|
|
|
15576
|
+
// src/mesh/model-provider-compat.ts
|
|
15577
|
+
function isAnthropicProvider(providerType) {
|
|
15578
|
+
const p = typeof providerType === "string" ? providerType.trim().toLowerCase() : "";
|
|
15579
|
+
return p.length > 0 && ANTHROPIC_PROVIDER_TYPES.has(p);
|
|
15580
|
+
}
|
|
15581
|
+
function isAnthropicModel(model) {
|
|
15582
|
+
const m = typeof model === "string" ? model.trim().toLowerCase() : "";
|
|
15583
|
+
if (!m) return false;
|
|
15584
|
+
if (m.startsWith("claude") || m.startsWith("anthropic")) return true;
|
|
15585
|
+
return /^(opus|sonnet|haiku)(\b|[-_])/.test(m);
|
|
15586
|
+
}
|
|
15587
|
+
function isModelCompatibleWithProvider(model, providerType) {
|
|
15588
|
+
if (!isAnthropicModel(model)) return true;
|
|
15589
|
+
if (isAnthropicProvider(providerType)) return true;
|
|
15590
|
+
return false;
|
|
15591
|
+
}
|
|
15592
|
+
var ANTHROPIC_PROVIDER_TYPES;
|
|
15593
|
+
var init_model_provider_compat = __esm({
|
|
15594
|
+
"src/mesh/model-provider-compat.ts"() {
|
|
15595
|
+
"use strict";
|
|
15596
|
+
ANTHROPIC_PROVIDER_TYPES = /* @__PURE__ */ new Set([
|
|
15597
|
+
"claude-cli"
|
|
15598
|
+
]);
|
|
15599
|
+
}
|
|
15600
|
+
});
|
|
15601
|
+
|
|
15571
15602
|
// src/mesh/mesh-queue-assignment.ts
|
|
15572
15603
|
function localCoordinatorDaemonId() {
|
|
15573
15604
|
return canonicalDaemonId(readNonEmptyString2(loadConfig().machineId));
|
|
@@ -16544,8 +16575,12 @@ async function maybeAutoLaunchOneQueueSession(components, meshId, mesh) {
|
|
|
16544
16575
|
markAutoLaunch(meshId, task.id, { status: "skipped", reason: resolved.reason || "provider_unusable", nodeId });
|
|
16545
16576
|
continue;
|
|
16546
16577
|
}
|
|
16547
|
-
const
|
|
16578
|
+
const rawEffectiveModel = typeof task.model === "string" && task.model.trim() ? task.model.trim() : resolved.model;
|
|
16548
16579
|
const effectiveThinkingLevel = typeof task.thinkingLevel === "string" && task.thinkingLevel.trim() ? task.thinkingLevel.trim() : resolved.thinkingLevel;
|
|
16580
|
+
const effectiveModel = isModelCompatibleWithProvider(rawEffectiveModel, resolved.providerType) ? rawEffectiveModel : void 0;
|
|
16581
|
+
if (rawEffectiveModel && effectiveModel === void 0) {
|
|
16582
|
+
LOG.info("MeshQueue", `CODEX-400 GUARD: dropped incompatible launch model '${rawEffectiveModel}' for non-Anthropic provider '${resolved.providerType}' on node ${nodeId} (task ${task.id}); provider will use its own default model`);
|
|
16583
|
+
}
|
|
16549
16584
|
const providerCap = resolveProviderMaxParallel(node?.policy, resolved.providerType);
|
|
16550
16585
|
if (providerCap !== void 0 && activeProviderAssignedCount(meshId, nodeId, resolved.providerType) >= providerCap) {
|
|
16551
16586
|
markAutoLaunch(meshId, task.id, { status: "skipped", reason: "max_provider_parallel_reached", nodeId, providerType: resolved.providerType });
|
|
@@ -16877,6 +16912,7 @@ var init_mesh_queue_assignment = __esm({
|
|
|
16877
16912
|
init_worktree_bootstrap_config();
|
|
16878
16913
|
init_mesh_clone_grace();
|
|
16879
16914
|
init_mesh_task_inflight();
|
|
16915
|
+
init_model_provider_compat();
|
|
16880
16916
|
IDLE_AUTO_FAST_FORWARD_THROTTLE_MS = 30 * 60 * 1e3;
|
|
16881
16917
|
idleAutoFastForwardLastAttempt = /* @__PURE__ */ new Map();
|
|
16882
16918
|
BOOTSTRAP_TERMINAL_STATUSES = /* @__PURE__ */ new Set(["complete", "failed"]);
|