loopctl-mcp-server 3.21.1 → 3.21.2

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.
@@ -33,7 +33,7 @@ export const TAKE_OVER_STEPS = Object.freeze([
33
33
  "If the row's run.work_left_behind is \"true\", the runner left unpushed commits on run.branch. runner_list gives the runner's host; the commits are in <repo>/.claude/worktrees/loop-story-<story_id> there. Push that branch or cherry-pick from it rather than starting over.",
34
34
  "Do the work through the normal delivery loop in the story's repo: branch from the repo's base branch (the intake source's base_branch in intake_source_list, the trunk the runner used), tests, the review round, a PR whose body says \"Fixes #<issue>\" so GitHub closes the issue, merge on green.",
35
35
  "Close the story: resolve_escalation {story_id, to: \"done\", reason: \"fixed by <owner/repo>#<PR>\"}. That needs LOOPCTL_USER_KEY, an operator key no dispatch minted; an interactive fleet session holds one, so the session that took the story over resolves it itself, never Mark. If the work turns out not to be wanted, use to: \"failed\" instead.",
36
- "Finish the escalation handoff loopctl posted for the story on its repo channel (handoff:<repo>:escalation-<story_id>-g<N>): claim it before you start (step 1 of its body) and channel_done it after the resolve. loopctl closes it itself once the story leaves escalated, and posts a new generation if it is finished while the story is still escalated.",
36
+ "Finish the escalation handoff loopctl posted for the story on its repo channel (handoff:<repo>:escalation-<story_id>-g<N>): claim it before you start (step 1 of its body). The resolve marks that claim done itself, so do not channel_done it afterwards (that answers 404); channel_done it only if you stop without resolving, and loopctl then posts a new generation while the story is still escalated.",
37
37
  ]);
38
38
 
39
39
  const ALREADY_MERGED =
package/lib/holder.js CHANGED
@@ -36,10 +36,20 @@
36
36
  * prevent. A uuid minted once per process stands in when neither is set.
37
37
  *
38
38
  * The raw credential lives only in this process's memory and is never returned by a tool.
39
+ *
40
+ * ## A runner session registers nothing
41
+ *
42
+ * loopctl-runner launches its sessions with LOOP_MODE set, and placement already made such a
43
+ * session a holder (US-52.15). With LOOP_MODE present, `register()` sends nothing and the
44
+ * session stays on LOOPCTL_AGENT_KEY, so the branch open (lib/branch-item.js) never runs.
39
45
  */
40
46
 
41
47
  import { envClaimSessionId } from "./claim-session.js";
42
48
 
49
+ function present(value) {
50
+ return typeof value === "string" && value.trim() !== "";
51
+ }
52
+
43
53
  export const HOLDERS_PATH = "/api/v1/holders";
44
54
 
45
55
  /** @param {string} id */
@@ -150,6 +160,13 @@ export function createHolderSession(deps) {
150
160
  }
151
161
 
152
162
  async function register() {
163
+ // A runner session (loopctl-runner sets LOOP_MODE) is already a holder, placed with its
164
+ // dispatch (US-52.15). Registering it as interactive made its branch a new work item on
165
+ // every heartbeat's open, which the factory then placed again (2026-11-21).
166
+ if (present(env.LOOP_MODE)) {
167
+ return { error: true, status: 0, body: "a runner session (LOOP_MODE) registers no interactive holder" };
168
+ }
169
+
153
170
  const key = plainKey();
154
171
  if (!key) return { error: true, status: 0, body: "LOOPCTL_AGENT_KEY is not set" };
155
172
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loopctl-mcp-server",
3
- "version": "3.21.1",
3
+ "version": "3.21.2",
4
4
  "description": "MCP server for loopctl — structural trust for AI development loops",
5
5
  "type": "module",
6
6
  "main": "index.js",