Skip to content

fix(cli,mcp): target-pin flag の値なし指定を USAGE 拒否 + dispatch budget 整合 (#383) - #387

Merged
rebuildup merged 1 commit into
release-0-6-0from
383
Nov 20, 2026
Merged

rebuildup merged 1 commit into
release-0-6-0from
383

Conversation

@rebuildup

Copy link
Copy Markdown
Contributor

概要

Issue #383。PR #379 の CodeRabbit Major findings 対応。

1. 値なし target-pin flag の USAGE 拒否

parseArgs は bare --project-file を true、--project-file= を "" にする。従来の typeof === "string" マッピングは両方を undefined(pin 無し)に落とし、--allow-mutation grant だけが残って「どの project にも pin されない mutation」が実行可能だった。

  • argv.mjs に missingFlagValue(flags, names) を追加。
  • cli.mjs(execute/verify): --project-file / --ae-version が存在するのに非空 string でない場合、run marker・session open の前に USAGE で refuse(exit 2)。
  • mcp-server/server.mjs(entry): 同じ検査を server 生成前に実施(exit 2)。

2. runner deadline と call timeout の整合

--call-timeout-ms 30000 のみ指定すると runner の deadlineMs は default 10s のまま → call budget 内に終わる host op が 10s で UNKNOWN/quarantine されていた。

  • 新規 a8n-transport/dispatch-budget.mjs の resolveDispatchBudgets() に集約:
    • deadlineMs 未指定時は callTimeoutMs + 500ms(従来の 9500/10000 関係を維持)を導出。
    • 明示ペアで deadlineMs <= callTimeoutMs は USAGE で refuse(launch/attach/census より前)。
  • owned(session.mjs) / attached(attached-session.mjs) 両 opener が同じ関数を使用。
  • 併せて修正: dev-loop/session-open.mjs が callTimeoutMs/deadlineMs を a8n-attached にしか転送しておらず、owned a8n では CLI/MCP の両 flag が silent に無視されていた。a8n opener にも転送するよう修正。

テスト(fake/mock レベル、real AE 不使用)

  • a8n-transport/tests/dispatch-budget.test.mjs(新規 7 tests): default 維持・導出・明示ペア・USAGE refuse・両 opener の pre-resolution refuse。
  • devtools-cli/tests/run.mjs: bare/=空値/verify 経路の USAGE refuse + marker 非生成 + 正常値の kind check 維持。
  • mcp-server/tests/server.test.mjs: spawn した実 entry point で exit 2 + stderr メッセージを検証。

実行結果: check-syntax 140 files pass、devtools-cli 51 tests、dev-loop 20 tests、a8n-transport 10/10 files、mcp-server 28 tests — 全 green。

検証レベル

  • automated test(fake host / spawned entry)のみ。real AE での dispatch budget 実測は未実施(fake-level fix)。

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: af7e719d-12b1-4b6a-8272-25d5c3f9f9d6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@rebuildup
rebuildup marked this pull request as ready for review November 20, 2026 20:51
@rebuildup
rebuildup merged commit c2b53bc into release-0-6-0 Nov 20, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant