@guanlin4924/devflow-pi 0.1.6 → 0.1.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guanlin4924/devflow-pi",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "type": "module",
5
5
  "description": "Devflow 专项研发 Pi,基于固定版本 OMP Runtime 组装研发状态机、代码智能、设计、实现与质量门禁。",
6
6
  "license": "UNLICENSED",
@@ -47,8 +47,6 @@ const STATE_MUTATION_TOOLS = new Set([
47
47
  "devflow_bootstrap",
48
48
  "devflow_transition",
49
49
  "devflow_artifact",
50
- "devflow_recovery",
51
- "devflow_context_sync",
52
50
  "devflow_evidence",
53
51
  ]);
54
52
 
@@ -1053,8 +1051,16 @@ export default function devflowCore(pi: ExtensionAPI) {
1053
1051
  });
1054
1052
  if (!result.ok || !result.stdout) return;
1055
1053
  try {
1056
- const decision = JSON.parse(result.stdout) as { decision?: string; reason?: string };
1054
+ const decision = JSON.parse(result.stdout) as { decision?: string; reason?: string; stop_block_count?: unknown };
1057
1055
  if (decision.decision === "block" && decision.reason) {
1056
+ const blockCount = typeof decision.stop_block_count === "number" ? decision.stop_block_count : 1;
1057
+ if (blockCount > 1) {
1058
+ ctx.ui.notify(
1059
+ "上下文同步确认未完成,已停止自动重试以避免重复消耗 token。请处理上一轮明确的失败原因后,再发送新的请求。",
1060
+ "warning",
1061
+ );
1062
+ return;
1063
+ }
1058
1064
  return {
1059
1065
  continue: true,
1060
1066
  additionalContext:
@@ -148,6 +148,7 @@ def stop_hook() -> int:
148
148
 
149
149
  with locked_state(root, session_id) as state:
150
150
  state["stop_block_count"] = int(state.get("stop_block_count", 0)) + 1
151
+ stop_block_count = state["stop_block_count"]
151
152
 
152
153
  file_text = "\n".join(f"- {path}" for path in files[:80])
153
154
  matched_text = ", ".join(matched[:20]) if matched else "none"
@@ -159,7 +160,16 @@ def stop_hook() -> int:
159
160
  "After validation succeeds, acknowledge this exact change set with the "
160
161
  f"devflow_context_sync tool using action=ack and level={level}."
161
162
  )
162
- print(json.dumps({"decision": "block", "reason": reason}, ensure_ascii=False))
163
+ print(
164
+ json.dumps(
165
+ {
166
+ "decision": "block",
167
+ "reason": reason,
168
+ "stop_block_count": stop_block_count,
169
+ },
170
+ ensure_ascii=False,
171
+ )
172
+ )
163
173
  return 0
164
174
 
165
175
 
@@ -27,6 +27,7 @@ state_contract:
27
27
  pending_steps:
28
28
  - diagnose
29
29
  - execute-fix
30
+ - code-index-refresh
30
31
  - reverify
31
32
  - lesson
32
33
 
package/src/runtime.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { existsSync } from "node:fs";
2
1
  import { mkdir } from "node:fs/promises";
3
2
  import path from "node:path";
4
3
 
@@ -79,13 +78,12 @@ export async function createEmbeddedRuntime(project: ProjectContext, options: Ru
79
78
  utils.logger.setTransports({ file: path.join(productHome, "logs") });
80
79
  const omp = await import("@oh-my-pi/pi-coding-agent");
81
80
  const roots = pluginRoots();
82
- const configFiles = [path.join(sharedAgentDir, "config.yml"), path.join(sharedAgentDir, "config.yaml")].filter(
83
- candidate => existsSync(candidate),
84
- );
81
+ // Reuse credentials and model discovery from the user's OMP agent, but not
82
+ // its config.yml: a global modelRoles block would override choices made in
83
+ // Devflow's own Roles screen after every restart.
85
84
  const settings = await omp.Settings.init({
86
85
  cwd: project.root,
87
86
  agentDir: productAgentDir,
88
- configFiles,
89
87
  overrides: {
90
88
  ...MANAGED_SETTINGS,
91
89
  // OMP 17.2.7 classifies extension-package skills behind the generic