Repository navigation
[v2] 装配公共执行服务、目录与演示入口 - #237
Merged
Merged
Conversation
ElephantGit
force-pushed
the
feat/774-execution-assembly
branch
from
October 31, 2026 01:55
082e55b to
437de52
Compare
ElephantGit
marked this pull request as ready for review
October 31, 2026 01:58
ObsisMc
approved these changes
Oct 31, 2026
ObsisMc
left a comment
Collaborator
There was a problem hiding this comment.
复审 head 437de52b44c1417439f52a9c8c08b6b2df980f22(基线 main bad9e4d7,落后 0)。
核对
- diff 已不含 #230 的
agentruntime/node内容;22 个文件都是v2-server/和frontend-v2/e2e下的交付物,描述写了「v2,不涉及 specs」和Refs ora-space/circus#774。 - 装配顺序正确:数据目录锁 →
agentruntime.New(含 Node 恢复;无资产时只做Recover)→executionruntime.New(先结算旧会话)→prepareDemo→ HTTP。退出时先ShutdownHTTP,再runtime.Close(join worker、关 driver),最后关数据库;Close未确认时不关库。 main把同一个 Service 同时注入Execution和Catalog,Projects也注入了,符合 owner 要求的"从server.Options接入、不各自改启动入口"。- owner 的 #231 结论已写进
projectrepos/README.md:演示成员可信,HTTPS 不限 host,不能作为不可信成员的抓取代理。 - 权限:
Start/Append检查当前成员关系;Cancel/End/ 读取走带 scope 的ReadExecutionSession;worker 用原归属写终态,ownership-only 写入没有暴露给页面。和 #228 reviewer 的提醒一致。 ced2ed59:BaseContext绑定进程信号 ctx,SIGTERM 时 SSE 观察者先退出,Shutdown不再卡到超时。437de52b:终态已发布、worker 还在 ACK/收尾时,Append先释放锁等prior.done,再循环重查关闭、授权、会话、attempt 和ending,不会重叠派发。仍在运行的轮次照旧返回 Busy。
本地验证(Go 1.27.1,aarch64,PostgreSQL 17.11 独立库)
go vet ./...、go build ./...通过。go test -race覆盖internal/executionruntime、internal/server、internal/store、internal/projectrepos和根包,全部通过。- 跳过
TestRealServiceAgentPostgresRestartAndConcurrentConversations和TestConfiguredProviderServicePostgresRestart:本机是 arm64,没有 x86_64 Node 资产,也没开 provider。真实 Node/Agent 以作者在原生 x86_64 上的验收和截图为准,我没有独立复跑。 - head 上的 server/frontend/e2e CI 全绿。
非阻塞建议
Service.failed是全进程的闸门:任何一个 worker 的终态写入失败,或 Agent 停止未确认,都会让整个服务拒绝所有新的 Start/Append(包括别人的纯模型对话),清单也返回 503,直到重启。README 写明了这是有意的 fail-closed,演示期可以接受;如果后续出现"一个 Agent 卡住导致全站不可用",可以考虑把闸门缩到项目或会话。workspaces、workspaceSession、ending三个 map 不回收,单进程演示问题不大,和 #230 的回收后置一起承接即可。
结论:可以合并;合并由 owner 决定。
This was referenced Oct 31, 2026
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.
将现有页面的公共执行注入点接到 PostgreSQL、纯模型执行和每项目 Node Driver。普通启动先恢复旧 Node/会话、准备真实 Demo Git 项目,再开放 HTTP;同一个 Service 提供执行与模型/执行器目录,并支持
-fixture-check和按归属停止后的-cleanup。已 rebase 到 main
bad9e4d7(#230 已合入);本 PR 仅保留公共 Service、catalog、启动与 demo 装配,diff 不再包含 Node Driver。保留当前 chat、成员、空间和项目接线。收到 SIGTERM 时取消 HTTP 请求上下文,让打开的 chat SSE 完成观察者清理,再关闭 runtime/数据库;HTTP 超时会关闭连接并保留退出错误。浏览器断开只结束自身观察。收到已持久化终态后的 Append 会等待原 worker 完成 ACK/收尾,再重查权限、会话与 attempt;真实运行中仍返回 Busy,避免终态发布与收尾间的下一轮排队停滞。
演示租户成员可信,项目创建允许任意 HTTPS 主机,服务器会访问给定地址;边界写入 projectrepos README。执行关闭失败返回错误并保留可能仍被 worker 使用的数据库句柄。
验证:Go 1.27.1 / PostgreSQL 17.11 下 gofmt、全包 vet/race/build;HTTP SSE 与连续轮次交接回归先确认旧行为失败,修复后通过。原生真实 Node/OpenCode 的公共 Service 并发、工具文件、取消、End、重开连接池与 Service 后完整读回通过(52.98s);正式 CLI fixture-check 通过(20.55s)。前端完整 check 通过(67 文件、490 测试),API 生成无漂移,全部 18 项 Playwright e2e 通过。实际浏览器验证真实 Agent 工具结果、刷新后历史读回,并在 SSE 页面打开时发送 SIGTERM,服务正常退出且无所属 Node 残留。当前 head 截图见关联运行。
本轮模型使用 fixture,外部 provider opt-in 未启用。v2,不涉及 specs。
Refs ora-space/circus#774