@guanlin4924/devflow-pi 0.1.33 → 0.1.34

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/README.md CHANGED
@@ -11,7 +11,7 @@ Devflow Pi 是一个面向项目研发交付的独立 OMP 产品入口,内置
11
11
  安装与启动:
12
12
 
13
13
  ```bash
14
- npm install -g @guanlin4924/devflow-pi@0.1.31
14
+ npm install -g @guanlin4924/devflow-pi@0.1.34
15
15
  cd /path/to/your-project
16
16
  devflow-pi init
17
17
  devflow-pi doctor
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guanlin4924/devflow-pi",
3
- "version": "0.1.33",
3
+ "version": "0.1.34",
4
4
  "type": "module",
5
5
  "description": "Devflow 专项研发 Pi,基于固定版本 OMP Runtime 组装研发状态机、代码智能、设计、实现与质量门禁。",
6
6
  "license": "UNLICENSED",
@@ -2722,6 +2722,27 @@ export default function devflowCore(pi: ExtensionAPI) {
2722
2722
  ctx.ui.notify("Devflow workflow is already complete.", "info");
2723
2723
  return;
2724
2724
  }
2725
+ // Re-arm a durable rollover left by an interrupted runtime. The
2726
+ // original source session is the only session allowed to resume a
2727
+ // prepared handoff; the runtime will claim it after the next command.
2728
+ const rolloverResult = await runRuby(ctx.cwd, "workflow-orchestrator/scripts/session_rollover.rb", ["inspect", "--json"]);
2729
+ const rolloverState = parseJsonResult(rolloverResult);
2730
+ const rollover = rolloverState?.rollover as Record<string, unknown> | undefined;
2731
+ const currentSessionId = ctx.sessionManager.getSessionId();
2732
+ if (
2733
+ rolloverState &&
2734
+ typeof rolloverState.revision === "number" &&
2735
+ rollover?.status === "prepared" &&
2736
+ rollover.source_session_id === currentSessionId &&
2737
+ typeof rollover.id === "string"
2738
+ ) {
2739
+ pendingRollover = {
2740
+ snapshot: inspected.snapshot,
2741
+ preparedRevision: rolloverState.revision,
2742
+ rolloverId: rollover.id,
2743
+ };
2744
+ await enqueueControlledRolloverRequest(ctx.cwd, rollover.id, currentSessionId);
2745
+ }
2725
2746
  setControlState(ctx, waitingUserState("等待用户审查步骤产物"));
2726
2747
  ctx.ui.notify(
2727
2748
  `Devflow 已恢复到 ${String((compactStep(inspected.snapshot.next_step) ?? compactStep(inspected.snapshot.current_step))?.id ?? "当前步骤")};请审查当前产物后明确回复“批准执行”,或直接提出修改意见。`,
package/src/constants.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export const PRODUCT_NAME = "Devflow Pi";
2
- export const PRODUCT_VERSION = "0.1.33";
2
+ export const PRODUCT_VERSION = "0.1.34";
3
3
  export const PROJECT_SCHEMA_VERSION = 1;
4
4
  export const OMP_RUNTIME_VERSION = "17.2.7";
5
5
 
package/src/runtime.ts CHANGED
@@ -203,7 +203,14 @@ export async function runInteractiveRuntime(project: ProjectContext, options: Ru
203
203
  mode.showWarning("已忽略无效或陈旧的 Devflow 会话轮换请求;STATE 未被修改。");
204
204
  return;
205
205
  }
206
- const switched = await runtime.session.newSession();
206
+ // Session creation can briefly be unavailable while the interactive mode
207
+ // finishes flushing the previous turn. Retry here because the handoff is
208
+ // already durable and STATE remains frozen until the target consumes it.
209
+ let switched = false;
210
+ for (let attempt = 0; attempt < 3 && !switched; attempt += 1) {
211
+ switched = await runtime.session.newSession();
212
+ if (!switched && attempt < 2) await new Promise(resolve => setTimeout(resolve, 100));
213
+ }
207
214
  if (!switched) {
208
215
  mode.showWarning("Devflow 会话轮换被运行时取消;当前会话保持不变。请检查控制面状态后重试。");
209
216
  return;