Title: [Bug]: Pi auto-continuation pauses silently on any non-injected prompt (including post-compaction context) — only /loopx resume re-arms it · Issue #6107 · loopx-project/loopx · GitHub
Open Graph Title: [Bug]: Pi auto-continuation pauses silently on any non-injected prompt (including post-compaction context) — only /loopx resume re-arms it · Issue #6107 · loopx-project/loopx
X Title: [Bug]: Pi auto-continuation pauses silently on any non-injected prompt (including post-compaction context) — only /loopx resume re-arms it · Issue #6107 · loopx-project/loopx
Description: Pi auto-continuation pauses silently on any non-injected prompt — including Pi's own post-compaction context — and only /loopx resume re-arms it Affected version: Pi surface installed from release 20261010T034436Z; the userPrompt/interru...
Open Graph Description: Pi auto-continuation pauses silently on any non-injected prompt — including Pi's own post-compaction context — and only /loopx resume re-arms it Affected version: Pi surface installed from release ...
X Description: Pi auto-continuation pauses silently on any non-injected prompt — including Pi's own post-compaction context — and only /loopx resume re-arms it Affected version: Pi surface installed from rele...
Opengraph URL: https://github.com/loopx-project/loopx/issues/6107
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Pi auto-continuation pauses silently on any non-injected prompt (including post-compaction context) — only /loopx resume re-arms it","articleBody":"# Pi auto-continuation pauses silently on any non-injected prompt — including Pi's own post-compaction context — and only `/loopx resume` re-arms it\n\n**Affected version:** Pi surface installed from release `20261010T034436Z`; the `userPrompt`/`interrupt` logic quoted below is identical in this repository at `0233a2f32` (`loopx/pi_goal_mode/pi-goal-loop-runtime.mjs`, `loopx/pi_goal_mode/index.ts`).\n**Host surface:** `pi` (Pi visible goal loop)\n**Impact:** a long-running Pi goal loop is disarmed by *any* prompt that is not the loop's own injected task body — including Pi's post-compaction context message and other system/queued work. The disarm is **silent** (no notification, no pause reason surfaced), the host looks healthy (`loopx status` clean, LoopX keeps reporting `should_run=true`), and every subsequent step then needs a human message. Recovery requires the owner to know about `/loopx resume`.\n\n## Code involved\n\n```js\n// loopx/pi_goal_mode/pi-goal-loop-runtime.mjs:1076\nasync userPrompt(key, prompt) {\n ...\n if (!binding || binding.terminal) return\n if (String(prompt || \"\") !== binding.lastInjectedPrompt) {\n const expected = { generation: binding.generation || 0, goalId: binding.goalId }\n const committed = await services.store.write(key, { autoResume: false }, expected)\n if (!committed) return\n if (disposed || epoch !== instanceEpoch) return\n cancelScheduled(key) // \u003c- no notify() on this path\n }\n},\n```\n\n```ts\n// loopx/pi_goal_mode/index.ts:619\npi.on(\"before_agent_start\", async (event, ctx) => {\n const { key } = bindContext(ctx)\n await loop.userPrompt(key, String(event.prompt || \"\"))\n})\n```\n\nCompare with the abort path, which *does* tell the user what happened:\n\n```js\n// pi-goal-loop-runtime.mjs:1097 (interrupt)\nservices.notify(`LoopX goal ${committed.goalId} auto-continuation paused after abort; run /loopx resume to continue.`, \"info\")\n```\n\nThe loop does correctly recognize its own turns (`lastInjectedPrompt` is set to the task body before the prompt is sent), so injected auto-continuation turns do not disarm it. The problem is everything else that reaches `before_agent_start`.\n\n## Observed behaviour\n\n* Session: one long-lived Pi session (`cwd` = the goal's project); the LoopX goal was armed and the loop ran for hours.\n* A Pi context **compaction** was recorded in that session's transcript at `2026-10-10T07:44:38Z`.\n* Afterwards the durable bridge state was:\n\n```json\n{ \"autoResume\": false, \"terminal\": false, \"generation\": 1,\n \"sessionKey\": \"2026-10-10T05-49-04-788Z_01a1245b-9794-71a9-9f76-bc39a6a15eadcb34\" }\n```\n\n i.e. a *pause*, not a lost binding — `sessionKey(process.env.PI_SESSION_FILE)` reproduces that key exactly, and `store.read(key)` resolves.\n* From that point on the loop produced no turns: every step required a human message. Nothing was shown in the UI.\n* The LoopX side was never the blocker: `quota should-run` kept returning `decision: run` / `should_run: true`, `scheduler_hint.action: run_now`, `cadence_class: active_work`, `must_attempt: true`.\n* Writing `autoResume: true` back into that same state file (what `/loopx resume` does) re-armed the loop.\n\n## Why this is a defect rather than intended behaviour\n\nA pause on *user* input is a reasonable design (the owner takes the wheel; explicitly re-arm afterwards). But:\n\n1. Pi's own automated context work (compaction, recovery, queued work — see `docs/extensions.md`: \"Automatic retries, recovery, compaction, or queued work can continue afterward\") is indistinguishable from user input at this event, so the loop is disarmed by the host's own housekeeping.\n2. The pause is silent, unlike the abort path which notifies. The user sees a healthy session and a stalled goal.\n3. Nothing durable records *why* it paused, so neither the user nor a diagnostic tool can tell \"paused by input\" from \"never armed\".\n\n## Suggested fixes (any of these)\n\n1. **Do not treat host-generated prompts as user input.** `before_agent_start` exposes the prompt plus structured `systemPromptOptions`, and the transcript records a `compaction` entry; use whichever signal is reliable to recognize compaction/recovery/queued runs and skip the disarm for them.\n2. **Notify on this path**, mirroring `interrupt()`: e.g. \"LoopX goal \u003cid> auto-continuation paused by input; run /loopx resume to continue.\"\n3. **Persist a pause reason** (e.g. `pauseReason: \"foreign_prompt\" | \"aborted\"`) in the bridge state so `/loopx status` and the host loop can surface it.\n4. Optionally **auto-re-arm** when the interrupting prompt was not user-authored.\n\n## Reproduction recipe\n\n1. Arm a LoopX goal in a Pi session and confirm one auto-continuation round.\n2. Trigger Pi context compaction (or send any manual message).\n3. Observe `.loopx/pi/\u003csessionKey>.json` flip to `autoResume: false` with no UI notification, and no further automatic turns, while LoopX continues to report `run_now` / `must_attempt: true`.\n","author":{"url":"https://github.com/hua03","@type":"Person","name":"hua03"},"datePublished":"2026-10-10T09:27:43Z","url":"https://github.com/loopx-project/loopx/issues/6107"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:683440ba-8a49-ccdd-44a6-68d63394cf4c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ADA2:E4848:105162:163763:6AED6E33 |
| html-safe-nonce | 5ea41a221b87a890b12f823533f6760fba5a5796260b7727aedd5f3b72e41600 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBREEyOkU0ODQ4OjEwNTE2MjoxNjM3NjM6NkFFRDZFMzMiLCJ2aXNpdG9yX2lkIjoiMTU2ODI3MTU4ODY4NTM0NDMwNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 239b46b8447452d9bb45e6ffefffe373f7f82f5ee8dae2f93cc34b1814f506f7 |
| hovercard-subject-tag | issue:5789968655 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/loopx-project/loopx/6107/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a669909d4a54fa6d392b7532e289d51d05bd71773b29873556166930c665786c/loopx-project/loopx/issues/6107 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a669909d4a54fa6d392b7532e289d51d05bd71773b29873556166930c665786c/loopx-project/loopx/issues/6107 |
| og:image:alt | Pi auto-continuation pauses silently on any non-injected prompt — including Pi's own post-compaction context — and only /loopx resume re-arms it Affected version: Pi surface installed from release ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hua03 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 56fb42677ae87ed3e64410323d67980aa65d0485568a7858f874e7edfc6d1c11 |
| turbo-cache-control | no-preview |
| go-import | github.com/loopx-project/loopx git https://github.com/loopx-project/loopx.git |
| octolytics-dimension-user_id | 331332701 |
| octolytics-dimension-user_login | loopx-project |
| octolytics-dimension-repository_id | 1255217938 |
| octolytics-dimension-repository_nwo | loopx-project/loopx |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1255217938 |
| octolytics-dimension-repository_network_root_nwo | loopx-project/loopx |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c9a37e2423ed382cf39f70b5aa4b4858b40a3b0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width