Skip to content

拒絕訊息沒有穩定的機器可讀碼:114 個 refusal 只有 5 個帶 E_ 代碼,其餘是自由文字(sister concern from #202) #212

Description

@kiki830621

問題

#202 把 114 個 return "Error: …" 的拒絕改成 throw,讓協定層的 isError 正確。但拒絕內容仍是 Error: 前綴的自由文字:

E_ 代碼
E_DIRTY_DOC 5 處
E_IMAGE_CONSISTENCY_INSPECTION 3
E_WORD_MCP_LOG_LEVEL 2
E_NO_AUTOSAVE 2
E_IMAGE_CONSISTENCY 1
無代碼(anchor 衝突、text_instance 範圍、invalid regex/scope、caption/equation 讀回失敗…) 100+

client(含 LLM harness 的重試邏輯)想分辨「anchor 衝突——換個 anchor 再試」與「dirty doc——先存或丟棄」仍要 parse 散文;措辭一改,分流就壞。

方向(待討論)

  • 給每類拒絕一個穩定代碼(沿用既有 E_ 慣例),放在訊息最前面:Error: E_ANCHOR_CONFLICT — insert_paragraph: received conflicting anchors: …
  • 或在 MCP result 加 structured content(_meta / 第二個 content block 帶 {code, tool, detail}),文字不動
  • 兩者都要一份代碼台帳(README 或 docs/error-codes.md),並用 sweep test 鎖「每個 ToolRefusal 都帶代碼」

先做 #202(協定層 isError),本票在其上加語意層;不要反過來。

Source: surfaced during /idd-diagnose #202 sister concern surfacing (Step 3.6)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions