refactor(error): centralize upstream taxonomy and jsonrpc translators#299
Merged
liujuanjuan1984 merged 2 commits intomainfrom Mar 23, 2026
Merged
refactor(error): centralize upstream taxonomy and jsonrpc translators#299liujuanjuan1984 merged 2 commits intomainfrom
liujuanjuan1984 merged 2 commits intomainfrom
Conversation
Collaborator
Author
|
本轮 PR 级审查结论:未发现阻塞问题。 判断:
一个需要明确记录但不阻塞合并的点:
|
Collaborator
Author
|
补了一轮死代码 / 薄壳清理,范围仅限本次 已收口:
说明:
验证:
|
Collaborator
Author
|
继续收了一轮:
验证:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
#274旨在收敛当前分散在多个出口的错误映射逻辑。当前主干在 client / tool 层已经有一部分中心化实现,但jsonrpc/application.py仍保留较多重复的JSONRPCError(...)/InvalidParamsError(...)/InternalError(...)组装逻辑,execution/upstream_errors.py也仍维护独立的 upstream 状态码画像。本 PR 按“共享 taxonomy + 分出口 translator”的方案落地收口,而不是再引入一个单体
ErrorTranslator。本次改动
src/opencode_a2a/error_taxonomy.pysrc/opencode_a2a/jsonrpc/error_mapping.pysrc/opencode_a2a/jsonrpc/application.pyJSONRPCError(...)/InvalidParamsError(...)/InternalError(...)组装接入 translatorsrc/opencode_a2a/execution/upstream_errors.pytests/jsonrpc/test_error_mapping.py相关 commit
932e380refactor(error): centralize upstream taxonomy and jsonrpc translators (#274)验证
uv run pre-commit run --all-filesuv run pytest348 passedcoverage: 91.07%