@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.mjs
CHANGED
|
@@ -412,10 +412,10 @@ function readInjected(value) {
|
|
|
412
412
|
}
|
|
413
413
|
function getDaemonBuildInfo() {
|
|
414
414
|
if (cached) return cached;
|
|
415
|
-
const commit = readInjected(true ? "
|
|
416
|
-
const commitShort = readInjected(true ? "
|
|
417
|
-
const version = readInjected(true ? "0.9.82-rc.
|
|
418
|
-
const builtAt = readInjected(true ? "2026-07-
|
|
415
|
+
const commit = readInjected(true ? "3c72ac19ec9253071d614cd2410dc9f8d555eb26" : void 0) ?? "unknown";
|
|
416
|
+
const commitShort = readInjected(true ? "3c72ac19" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
417
|
+
const version = readInjected(true ? "0.9.82-rc.508" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
418
|
+
const builtAt = readInjected(true ? "2026-07-12T23:18:59.856Z" : void 0);
|
|
419
419
|
cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
|
|
420
420
|
return cached;
|
|
421
421
|
}
|
|
@@ -3922,7 +3922,7 @@ function buildRulesSection(coordinatorCliType) {
|
|
|
3922
3922
|
|
|
3923
3923
|
- **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.
|
|
3924
3924
|
- **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\`.
|
|
3925
|
-
- **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
|
|
3925
|
+
- **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.
|
|
3926
3926
|
- **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.
|
|
3927
3927
|
- **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.
|
|
3928
3928
|
- **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.
|
|
@@ -3930,12 +3930,15 @@ function buildRulesSection(coordinatorCliType) {
|
|
|
3930
3930
|
- **Verify via git, not source.** Use \`mesh_git_status\` to confirm side effects. Treat agent summaries as self-reports, not verification.
|
|
3931
3931
|
- **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).
|
|
3932
3932
|
- **Check history first.** Call \`mesh_task_history\` at session start to avoid duplicate work and inform recovery. On failure, read task history before retrying.
|
|
3933
|
+
- **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.
|
|
3933
3934
|
- **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.
|
|
3934
3935
|
- **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\`.
|
|
3935
3936
|
- **Refinery is config-driven.** \`mesh_refine_node\` must run validation from \`.adhdev/refine.{json,yaml,yml}\` or \`repo-mesh.refine.*\`. Heuristics are scaffolding only.
|
|
3936
3937
|
- **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\`.
|
|
3937
3938
|
- **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.
|
|
3938
3939
|
- **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\`.
|
|
3940
|
+
- **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.
|
|
3941
|
+
- **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.
|
|
3939
3942
|
- **Never fabricate tool results.** Always call the actual tool.
|
|
3940
3943
|
- **Keep the user informed.** One or two sentences after each delegation round.${coordinatorNote}
|
|
3941
3944
|
|
|
@@ -4037,7 +4040,9 @@ Follow these recovery rules:
|
|
|
4037
4040
|
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.
|
|
4038
4041
|
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.
|
|
4039
4042
|
3. **If no recovery context**: The stop may be intentional (normal completion). Use \`mesh_read_chat\` once to verify, then move on.
|
|
4040
|
-
4. **Always record what happened**: After handling a failure, briefly note the outcome in your report to the user
|
|
4043
|
+
4. **Always record what happened**: After handling a failure, briefly note the outcome in your report to the user.
|
|
4044
|
+
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.
|
|
4045
|
+
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.`;
|
|
4041
4046
|
ONBOARDING_SECTION = `## Onboarding / Reinit
|
|
4042
4047
|
|
|
4043
4048
|
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.
|
|
@@ -15570,6 +15575,32 @@ var init_mesh_clone_grace = __esm({
|
|
|
15570
15575
|
}
|
|
15571
15576
|
});
|
|
15572
15577
|
|
|
15578
|
+
// src/mesh/model-provider-compat.ts
|
|
15579
|
+
function isAnthropicProvider(providerType) {
|
|
15580
|
+
const p = typeof providerType === "string" ? providerType.trim().toLowerCase() : "";
|
|
15581
|
+
return p.length > 0 && ANTHROPIC_PROVIDER_TYPES.has(p);
|
|
15582
|
+
}
|
|
15583
|
+
function isAnthropicModel(model) {
|
|
15584
|
+
const m = typeof model === "string" ? model.trim().toLowerCase() : "";
|
|
15585
|
+
if (!m) return false;
|
|
15586
|
+
if (m.startsWith("claude") || m.startsWith("anthropic")) return true;
|
|
15587
|
+
return /^(opus|sonnet|haiku)(\b|[-_])/.test(m);
|
|
15588
|
+
}
|
|
15589
|
+
function isModelCompatibleWithProvider(model, providerType) {
|
|
15590
|
+
if (!isAnthropicModel(model)) return true;
|
|
15591
|
+
if (isAnthropicProvider(providerType)) return true;
|
|
15592
|
+
return false;
|
|
15593
|
+
}
|
|
15594
|
+
var ANTHROPIC_PROVIDER_TYPES;
|
|
15595
|
+
var init_model_provider_compat = __esm({
|
|
15596
|
+
"src/mesh/model-provider-compat.ts"() {
|
|
15597
|
+
"use strict";
|
|
15598
|
+
ANTHROPIC_PROVIDER_TYPES = /* @__PURE__ */ new Set([
|
|
15599
|
+
"claude-cli"
|
|
15600
|
+
]);
|
|
15601
|
+
}
|
|
15602
|
+
});
|
|
15603
|
+
|
|
15573
15604
|
// src/mesh/mesh-queue-assignment.ts
|
|
15574
15605
|
import { existsSync as existsSync18 } from "fs";
|
|
15575
15606
|
function localCoordinatorDaemonId() {
|
|
@@ -16547,8 +16578,12 @@ async function maybeAutoLaunchOneQueueSession(components, meshId, mesh) {
|
|
|
16547
16578
|
markAutoLaunch(meshId, task.id, { status: "skipped", reason: resolved.reason || "provider_unusable", nodeId });
|
|
16548
16579
|
continue;
|
|
16549
16580
|
}
|
|
16550
|
-
const
|
|
16581
|
+
const rawEffectiveModel = typeof task.model === "string" && task.model.trim() ? task.model.trim() : resolved.model;
|
|
16551
16582
|
const effectiveThinkingLevel = typeof task.thinkingLevel === "string" && task.thinkingLevel.trim() ? task.thinkingLevel.trim() : resolved.thinkingLevel;
|
|
16583
|
+
const effectiveModel = isModelCompatibleWithProvider(rawEffectiveModel, resolved.providerType) ? rawEffectiveModel : void 0;
|
|
16584
|
+
if (rawEffectiveModel && effectiveModel === void 0) {
|
|
16585
|
+
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`);
|
|
16586
|
+
}
|
|
16552
16587
|
const providerCap = resolveProviderMaxParallel(node?.policy, resolved.providerType);
|
|
16553
16588
|
if (providerCap !== void 0 && activeProviderAssignedCount(meshId, nodeId, resolved.providerType) >= providerCap) {
|
|
16554
16589
|
markAutoLaunch(meshId, task.id, { status: "skipped", reason: "max_provider_parallel_reached", nodeId, providerType: resolved.providerType });
|
|
@@ -16879,6 +16914,7 @@ var init_mesh_queue_assignment = __esm({
|
|
|
16879
16914
|
init_worktree_bootstrap_config();
|
|
16880
16915
|
init_mesh_clone_grace();
|
|
16881
16916
|
init_mesh_task_inflight();
|
|
16917
|
+
init_model_provider_compat();
|
|
16882
16918
|
IDLE_AUTO_FAST_FORWARD_THROTTLE_MS = 30 * 60 * 1e3;
|
|
16883
16919
|
idleAutoFastForwardLastAttempt = /* @__PURE__ */ new Map();
|
|
16884
16920
|
BOOTSTRAP_TERMINAL_STATUSES = /* @__PURE__ */ new Set(["complete", "failed"]);
|