@ifrankwang/openspec-agents 0.147.1 → 0.147.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.
@@ -8213,18 +8213,24 @@ async function agentSubmitExecute(params, ctx) {
8213
8213
  throw new Error(`worktree 未就绪,当前拒绝提交。
8214
8214
  请编排者先调用 opx_orch_set_worktree 确保 worktree 就绪后再提交。`);
8215
8215
  }
8216
- if (params.fixed_issue_ids)
8217
- params.fixed_issue_ids = params.fixed_issue_ids.map(normalizeIssueId);
8218
- if (params.exempt_issue_ids)
8219
- params.exempt_issue_ids = params.exempt_issue_ids.map(normalizeIssueId);
8220
- if (params.exempt_adjudications) {
8221
- for (const adj of params.exempt_adjudications)
8222
- adj.issue_id = normalizeIssueId(adj.issue_id);
8223
- }
8224
- if (params.recheck_adjudications) {
8225
- for (const adj of params.recheck_adjudications)
8226
- adj.issue_id = normalizeIssueId(adj.issue_id);
8227
- }
8216
+ const normalized = { ...params };
8217
+ if (normalized.fixed_issue_ids)
8218
+ normalized.fixed_issue_ids = normalized.fixed_issue_ids.map(normalizeIssueId);
8219
+ if (normalized.exempt_issue_ids)
8220
+ normalized.exempt_issue_ids = normalized.exempt_issue_ids.map(normalizeIssueId);
8221
+ if (normalized.exempt_adjudications) {
8222
+ normalized.exempt_adjudications = normalized.exempt_adjudications.map((adj) => ({
8223
+ ...adj,
8224
+ issue_id: normalizeIssueId(adj.issue_id)
8225
+ }));
8226
+ }
8227
+ if (normalized.recheck_adjudications) {
8228
+ normalized.recheck_adjudications = normalized.recheck_adjudications.map((adj) => ({
8229
+ ...adj,
8230
+ issue_id: normalizeIssueId(adj.issue_id)
8231
+ }));
8232
+ }
8233
+ params = normalized;
8228
8234
  const knownChildIds = new Set;
8229
8235
  for (const c of item.children) {
8230
8236
  knownChildIds.add(c.id);
@@ -8984,7 +8990,7 @@ function buildNativeToolExecutes(unattended, processCwd) {
8984
8990
  const wrap = (execute) => async (args, exec) => {
8985
8991
  exec.signal?.throwIfAborted?.();
8986
8992
  const ctx = resolveToolContext(exec, args, { processCwd });
8987
- const cleanArgs = { ...args };
8993
+ const cleanArgs = structuredClone(args);
8988
8994
  delete cleanArgs[AGENT_ARG];
8989
8995
  if (unattended)
8990
8996
  await ensureDefaultUnattended(cleanArgs, ctx);
@@ -29810,18 +29810,24 @@ async function agentSubmitExecute(params, ctx) {
29810
29810
  throw new Error(`worktree 未就绪,当前拒绝提交。
29811
29811
  请编排者先调用 opx_orch_set_worktree 确保 worktree 就绪后再提交。`);
29812
29812
  }
29813
- if (params.fixed_issue_ids)
29814
- params.fixed_issue_ids = params.fixed_issue_ids.map(normalizeIssueId);
29815
- if (params.exempt_issue_ids)
29816
- params.exempt_issue_ids = params.exempt_issue_ids.map(normalizeIssueId);
29817
- if (params.exempt_adjudications) {
29818
- for (const adj of params.exempt_adjudications)
29819
- adj.issue_id = normalizeIssueId(adj.issue_id);
29820
- }
29821
- if (params.recheck_adjudications) {
29822
- for (const adj of params.recheck_adjudications)
29823
- adj.issue_id = normalizeIssueId(adj.issue_id);
29813
+ const normalized = { ...params };
29814
+ if (normalized.fixed_issue_ids)
29815
+ normalized.fixed_issue_ids = normalized.fixed_issue_ids.map(normalizeIssueId);
29816
+ if (normalized.exempt_issue_ids)
29817
+ normalized.exempt_issue_ids = normalized.exempt_issue_ids.map(normalizeIssueId);
29818
+ if (normalized.exempt_adjudications) {
29819
+ normalized.exempt_adjudications = normalized.exempt_adjudications.map((adj) => ({
29820
+ ...adj,
29821
+ issue_id: normalizeIssueId(adj.issue_id)
29822
+ }));
29823
+ }
29824
+ if (normalized.recheck_adjudications) {
29825
+ normalized.recheck_adjudications = normalized.recheck_adjudications.map((adj) => ({
29826
+ ...adj,
29827
+ issue_id: normalizeIssueId(adj.issue_id)
29828
+ }));
29824
29829
  }
29830
+ params = normalized;
29825
29831
  const knownChildIds = new Set;
29826
29832
  for (const c of item.children) {
29827
29833
  knownChildIds.add(c.id);
@@ -30569,7 +30575,7 @@ async function ensureDefaultUnattended(args, ctx) {
30569
30575
  }
30570
30576
  } catch {}
30571
30577
  }
30572
- var PKG_VERSION = "0.147.1";
30578
+ var PKG_VERSION = "0.147.2";
30573
30579
  function buildMcpServer(worktree, opts = {}) {
30574
30580
  const mcp = new McpServer({ name: "openspec-agents", version: PKG_VERSION });
30575
30581
  for (const [name, spec] of Object.entries(TOOL_SPECS)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ifrankwang/openspec-agents",
3
- "version": "0.147.1",
3
+ "version": "0.147.2",
4
4
  "description": "OpenSpec change orchestration plugin for AI coding agents (Claude Code, Codex, ZCode, DeepSeek Harness, OpenCode)",
5
5
  "author": "ifrankwang",
6
6
  "license": "MIT",
@@ -132,7 +132,8 @@ export function buildNativeToolExecutes(
132
132
  exec.signal?.throwIfAborted?.()
133
133
  const ctx = resolveToolContext(exec, args, { processCwd })
134
134
  // 私有身份参数不进入内核参数(内核校验的是纯业务 schema)。
135
- const cleanArgs: Record<string, unknown> = { ...args }
135
+ // DSH 会把入参整份深冻结后原样交给 execute,这里必须交出可写副本(浅拷贝只保护顶层,嵌套仍只读)。
136
+ const cleanArgs: Record<string, unknown> = structuredClone(args)
136
137
  delete cleanArgs[AGENT_ARG]
137
138
  if (unattended) await ensureDefaultUnattended(cleanArgs, ctx)
138
139
  const result = await execute(cleanArgs, ctx)
@@ -619,15 +619,25 @@ export async function agentSubmitExecute(params: AgentSubmitParams, ctx: ToolCon
619
619
  )
620
620
  }
621
621
 
622
- // 参数归一化:issue id 去 # 前缀(fixed/exempt/adjudication/recheck 均接受带 # 的 tg.issue 序号引用)
623
- if (params.fixed_issue_ids) params.fixed_issue_ids = params.fixed_issue_ids.map(normalizeIssueId)
624
- if (params.exempt_issue_ids) params.exempt_issue_ids = params.exempt_issue_ids.map(normalizeIssueId)
625
- if (params.exempt_adjudications) {
626
- for (const adj of params.exempt_adjudications) adj.issue_id = normalizeIssueId(adj.issue_id)
622
+ // 参数归一化:issue id 去 # 前缀(fixed/exempt/adjudication/recheck 均接受带 # 的 tg.issue 序号引用)。
623
+ // 归一化结果必须回写到 params 绑定:其后的读取点全部依赖归一化后的值。宿主(DSH)可能把入参整份
624
+ // 冻结为只读,因此只能在可写副本上归一化,不能动传入对象(含嵌套元素)。
625
+ const normalized: AgentSubmitParams = { ...params }
626
+ if (normalized.fixed_issue_ids) normalized.fixed_issue_ids = normalized.fixed_issue_ids.map(normalizeIssueId)
627
+ if (normalized.exempt_issue_ids) normalized.exempt_issue_ids = normalized.exempt_issue_ids.map(normalizeIssueId)
628
+ if (normalized.exempt_adjudications) {
629
+ normalized.exempt_adjudications = normalized.exempt_adjudications.map((adj) => ({
630
+ ...adj,
631
+ issue_id: normalizeIssueId(adj.issue_id),
632
+ }))
627
633
  }
628
- if (params.recheck_adjudications) {
629
- for (const adj of params.recheck_adjudications) adj.issue_id = normalizeIssueId(adj.issue_id)
634
+ if (normalized.recheck_adjudications) {
635
+ normalized.recheck_adjudications = normalized.recheck_adjudications.map((adj) => ({
636
+ ...adj,
637
+ issue_id: normalizeIssueId(adj.issue_id),
638
+ }))
630
639
  }
640
+ params = normalized
631
641
 
632
642
  // 无效 fixed/exempt id 入口显式拒绝(不静默吞掉修复/豁免声明):未命中的 id 抛错并列出可用 id 清单。
633
643
  // 以 resolveChildByIssueId 做权威判定,与 submitForStep 的 childById 及 collectFixedExemptLayers 消费端解析语义一致。