fix(upstream): add fast-fail concurrency guards#327
Merged
liujuanjuan1984 merged 3 commits intomainfrom Mar 26, 2026
Merged
Conversation
Collaborator
Author
|
本轮复审结论:未发现新的阻塞性问题。 判断依据:
残余风险只有一项,且当前可接受:
issue 关系复核:
|
3 tasks
Collaborator
Author
|
补充修正:README 里的 原因:这个变量描述的是当前服务实例的 durable task store 配置,不属于 outbound peer call 的 credential 示例。 |
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.
概述
本 PR 在当前分支上合并了三类改动:
opencode-a2a call示例只表达 outbound peer credential 注入,不再混入服务端 database store 配置。#276所跟踪的 upstream adapter 最小并发保护,采用 fast-fail 策略收敛 unary/control 与 streaming 请求的资源边界。模块一:README 启动示例修正
对应提交:
91a68e7、ee8547copencode-a2a服务启动命令中补充A2A_TASK_STORE_DATABASE_URL=sqlite+aiosqlite:///./opencode-a2a.db。opencode-a2a call示例里的 database URL 移回服务端启动示例。模块二:upstream 并发保护与错误收敛
对应提交:
3f63b9dOpencodeUpstreamClient中增加 fast-fail 并发预算:OPENCODE_MAX_CONCURRENT_REQUESTSOPENCODE_MAX_CONCURRENT_STREAMS0表示不限制,>0表示启用快速失败式并发上限。/eventstream 与普通 unary/control upstream 请求分开建预算,避免二者混用同一资源边界。UpstreamConcurrencyLimitError,不泄露底层 transport 细节。模块三:协议层错误映射、文档与测试
对应提交:
3f63b9dUPSTREAM_BACKPRESSURE。UPSTREAM_UNREACHABLE响应,并附带 detail。guide.md补充新的并发配置项说明,并修正过时的 outbound auth 文案。验证
uv run pytest --no-cov tests/upstream/test_opencode_upstream_client_params.py tests/execution/test_agent_errors.py tests/jsonrpc/test_error_responses.py tests/jsonrpc/test_opencode_session_extension_queries.py tests/jsonrpc/test_opencode_session_extension_prompt_async.py tests/jsonrpc/test_opencode_session_extension_interrupts.py./scripts/doctor.sh结果:
392 passed,coverage91.79%。关联
Closes #276