@guanlin4924/devflow-pi 0.1.6 → 0.1.7
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
|
@@ -48,7 +48,6 @@ const STATE_MUTATION_TOOLS = new Set([
|
|
|
48
48
|
"devflow_transition",
|
|
49
49
|
"devflow_artifact",
|
|
50
50
|
"devflow_recovery",
|
|
51
|
-
"devflow_context_sync",
|
|
52
51
|
"devflow_evidence",
|
|
53
52
|
]);
|
|
54
53
|
|
|
@@ -1053,8 +1052,16 @@ export default function devflowCore(pi: ExtensionAPI) {
|
|
|
1053
1052
|
});
|
|
1054
1053
|
if (!result.ok || !result.stdout) return;
|
|
1055
1054
|
try {
|
|
1056
|
-
const decision = JSON.parse(result.stdout) as { decision?: string; reason?: string };
|
|
1055
|
+
const decision = JSON.parse(result.stdout) as { decision?: string; reason?: string; stop_block_count?: unknown };
|
|
1057
1056
|
if (decision.decision === "block" && decision.reason) {
|
|
1057
|
+
const blockCount = typeof decision.stop_block_count === "number" ? decision.stop_block_count : 1;
|
|
1058
|
+
if (blockCount > 1) {
|
|
1059
|
+
ctx.ui.notify(
|
|
1060
|
+
"上下文同步确认未完成,已停止自动重试以避免重复消耗 token。请处理上一轮明确的失败原因后,再发送新的请求。",
|
|
1061
|
+
"warning",
|
|
1062
|
+
);
|
|
1063
|
+
return;
|
|
1064
|
+
}
|
|
1058
1065
|
return {
|
|
1059
1066
|
continue: true,
|
|
1060
1067
|
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(
|
|
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
|
|