Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

chore: reconcile the endpoint cap with main's mission-release and AGENTS.md rename (#4834)

[._.]/ Adam Eivy45f0dbf8d639
diff --git a/server/services/cos.js b/server/services/cos.js
index 5bff0b58e9..a12d51b1f9 100644
--- a/server/services/cos.js
+++ b/server/services/cos.js
@@ -1177,10 +1177,9 @@ async function spawnDequeuePriority3Missions(ctx) {
// Committed tier — `generateMissionTasks` has already flipped the sub-task to
// `in_progress` and saved the mission, and mission tasks are never written to
// COS-TASKS.md, so a denial drops the only copy of a sub-task that
- // `generateMissionTask` will never re-pick (it selects `pending` only). See
- // canSpawnCommitted (#4834). Note the emit does NOT recover the sub-task
- // either — `holdTask` releases `metadata.app`/`jobId`, and a mission task
- // carries neither — it just avoids making the loss worse here. Filed as #4858.
+ // `generateMissionTask` will never re-pick (it selects `pending` only).
+ // Emitting hands it to the chokepoint, whose `holdTask` reverts the flip
+ // (#4858) — so the sub-task really is recovered. See canSpawnCommitted (#4834).
if (!capacity.canSpawnCommitted(cosTask, ctx.autonomousSpawnCeiling)) continue;
cosEvents.emit('task:ready', cosTask);
capacity.trackSpawn(cosTask);
diff --git a/server/services/cosDequeue.js b/server/services/cosDequeue.js
index 2c66aeeac9..c4ba64597b 100644
--- a/server/services/cosDequeue.js
+++ b/server/services/cosDequeue.js
@@ -54,7 +54,8 @@
* - Priority 0 has cleared the on-demand request and bound the app-review
* marker — a denial silently swallows the user's explicit "Run".
* - Priority 3 has flipped the mission sub-task to `in_progress` and saved the
- * mission; `generateMissionTask` only ever re-picks `pending` sub-tasks.
+ * mission; `generateMissionTask` only ever re-picks `pending` sub-tasks, and
+ * the emitted object is the only copy (holdTask reverts the flip — #4858).
* - Priority 4 has bound the app-review marker and advanced the 30-minute
* review cooldown (issue #978's failure mode).
*
diff --git a/server/services/cosLocalEndpointSlots.js b/server/services/cosLocalEndpointSlots.js
index 1cf4a1ddae..17f6cfddd3 100644
--- a/server/services/cosLocalEndpointSlots.js
+++ b/server/services/cosLocalEndpointSlots.js
@@ -205,7 +205,7 @@ export async function buildLocalEndpointSlotContext() {
// So the chokepoint reserves the slot up front and releases it once the spawn
// settles — by which point the agent record carries the load. This is a simple
// in-process re-entrancy guard over one server's own dispatch loop, not a
-// defense against competing actors (see the Security Model in CLAUDE.md).
+// defense against competing actors (see the Security Model in AGENTS.md).
// Mirrors `spawningJobIds` in cosJobScheduler.js, which bridges the same gap.
//
// Each reservation carries its task id, because `registerAgent` flips the record