Skip to content

fix(plugins): etherscan-autolink / web-search の ### メタデータから https:// を除く - #100

Merged
hitalin merged 1 commit into
mainfrom
fix/plugin-meta-slashes
Nov 4, 2026
Merged

hitalin merged 1 commit into
mainfrom
fix/plugin-meta-slashes

Conversation

@hitalin

@hitalin hitalin commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

問題

NoteDeck の parseMetaBlock (src/aiscript/plugin-api.ts) は ### ブロック全体に行コメント除去 (/\/\/[^\n]*/g) を当ててから JSON として読む。文字列の中でも // 以降が消えるため、description / label / default に書いた https:// で JSON が壊れて行単位の fallback 解析に落ち、config がオブジェクトにならない。結果 Plugin:config が空になり、設定値を .trim() などで触った時点で Cannot read prop of null で落ちる。

AiScript 本来の collectMetadata を使う check-registry-integrity / contract:verify では通ってしまうので、NoteDeck に入れて初めて気付く。NoteDeck の解析を写したスクリプトで全 44 プラグインを調べ、壊れるのはこの 2 つ (と別 PR で出す mfm-search-engine) だった。

変更

  • etherscan-autolink 1.0.1: description と default から https:// を除き、default を etherscan.io に。explorerBase() でスキーム無しなら https:// を補い、空文字は既定に戻す
  • web-search 1.0.1: label の例を searx.example.com に。searxngUrl にスキームが無ければ https:// を補う
  • registry JSON 再生成

検証

NoteDeck と同じ手順で ### を解析して default から Plugin:config を組み、Interpreter で実行:

  • explorerBase 未設定 / basescan.org / https://arbiscan.io/ / 空 / http://evil.example / null → 期待どおりの URL (http と不正値は既定に戻る)
  • searxngUrl searx.example.com / https://searx.example.com/ → https://searx.example.com/search?q=…、未設定は toast
  • registry:build / check-registry-integrity / contract:verify / i18n:lint 合格

NoteDeck 側の根本原因は別途 issue。

🤖 Generated with Claude Code

…を除く (NoteDeck の解析で // 以降が消えて Plugin:config が空になる)

NoteDeck の parseMetaBlock は ### ブロック全体に行コメント除去を当ててから JSON を読むので、
description / label / default の文字列中の `https://` でも行末まで消えて JSON が壊れ、行単位の
fallback に落ちて config がオブジェクトにならない。結果 Plugin:config が空になり、設定値を
`.trim()` などで触った時点で "Cannot read prop of null" で落ちる。

- etherscan-autolink 1.0.1: default を `etherscan.io` (ホストのみ) にし、explorerBase() で
  スキーム無しなら `https://` を補う。空文字は既定に戻す
- web-search 1.0.1: label の例から `https://` を除き、searxngUrl にスキームが無ければ補う

NoteDeck と同じ手順で ### を解析して default から Plugin:config を組む検証 9 件で確認
(explorerBase 未設定 / ホストのみ / https / 空 / http / null、searxngUrl ホストのみ / https / 未設定)。

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

  • 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

@hitalin hitalin self-assigned this Nov 4, 2026
@hitalin
hitalin merged commit 125abcf into main Nov 4, 2026
3 of 5 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