Repository navigation
fix(runtime): allow offline cancellation of existing source analyses - #7352
Conversation
Keep namespace, original Goal and existing pack/job identity checks for local cancellation. Preserve fresh source membership checks for starts and retries, and add HTTP/process regressions for offline cancellation. Related to #6878. Signed-off-by: Codex <codex@openai.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · max
动机
在独立工作区分析既有来源、随后需要停止本机分析的用户。
分析已在本机启动后,原来源离线或不再登记该 Goal,旧入口先读来源并返回503或404,用户无法终止原子进程;本头对取消使用已固定的本地作业身份,新建和重试仍重新核验来源。
同一实际HTTP与合成子进程回归在不可变基线复现两种取消失败;本头终止原作业并保存cancelled,provider恰启动一次,错误身份不能取消。
不新增分析启动入口,不放宽新建或重试准入,不授予原来源Goal的生命周期或写权限;不声称离线事实浏览、真实SSH、安装态或模型质量已验收。
已有原作业和本地凭据足以证明“停止哪个工作”,继续依赖来源可用性会让取消操作被错误的前置条件挡住。本结论仅针对这个已复现缺口。
改动思路
沿用现有HTTP namespace/请求验证与工具包的pack、key、既有job和进程所有权,仅从GoalSource已有访问校验中提取固定范围检查;取消不再依赖实时来源,其他调用仍检查连接。
交付既有取消通路的有界修复;来源事实读、重试、进程生命周期与持久化owner仍归原实现,不建立第二个provider或权限体系。
| 请求 | 基线与本头边界 |
|---|---|
| 新建或重试 | 保留实际来源和当前登记关系的新读取,展示缓存不能授权执行 |
| 取消既有本机作业 | 本头只核验固定范围与原作业,来源失联不会阻止原进程 owner 取消 |
| 未启用分析或身份不符 | 保留原拒绝与零副作用 |
这张表由源码与下述实际HTTP验证支撑。主 App 的 linked-source 分支本来就以 verify_source=not cancel 区分两类操作;独立工作区补齐相同生命周期含义,保留自己的 prepared-source owner。不能移除所有POST的来源检查,也不需新进程管理器。
具体改动
先读原规格 trajectory-assessment 及 #6878纠正发现,spec_revision 2b72d30fca7f452a71dffb723ebf6d1e2e878484。offline_existing_cancel、pinned_identity、fresh_new_work 三项在本头均 implemented;重基后的实际比较基线为 b95223532af1cc3cc6bd9558f96750c79f581e1b。5944经验用于检查普通用户任务、错误恢复和实际结果,不继承其历史评价。
关键代码讲解
GoalSource.check_scope:146:把原来的Goal格式与固定选择检查提取为不访问连接的纯方法;没有创建新的权限状态。GoalSource.check_access:155:调用相同固定检查,继续拒绝已移除的SSH alias。普通status/history等调用者未改用宽松入口。RuntimeWorkspaceHandler._research_analysis_scope:106:仅cancel=True使用固定范围;新建、重试仍registered_status(..., fresh=True)。共享handler保留namespace、请求体和原Goal/pack/key验证,工具包仍要求既有作业,并由原Popen对象的owner终止自己的子进程,不接受任意PID。
整PR四文件 +92/-6,其中生产代码 +15/-6、测试新增73行、参考合同新增4行。测试复用原HTTP、pack注册和合成子进程fixture,保留基线失败时“恢复来源后取消原进程”的finally清理。文档只在既有显式启用段落说明取消例外,没有改变安装、激活或默认权限。
现有前端 cancel() 发送原namespace/Goal/pack/key,不以 readError 清除为前提;同一来源读取失败保留原snapshot。页面、按钮和布局均未改,本轮没有新增浏览器或安装态展示资格。事实读取仍使用原短缓存和来源核验;测试恢复来源后才读回持久化cancelled,不声称离线事实浏览已经交付。
对主干的风险
最强反例是取消的修复同时放宽了错误身份或新执行准入。我在与不可变 b95223532af1cc3cc6bd9558f96750c79f581e1b 全部生产树一致的独立检出上执行本头未经修改的两种离线回归,分别在取消处实际得到503/404;原finally恢复来源并正常清理。这两个失败完整保留。切换到 2ffc25e152b44dceea3a12a75fd38164627342b8 后,六个原模块 99项测试通过、零跳过,覆盖真实HTTP、本地pack/job/receipt和真实合成子进程。原作业返回cancelled,provider只有一次启动,原来源文件字节不变;错误namespace/Goal/pack/key和不存在的作业不会产生取消标记,原作业继续到正确取消。
另外以完整不可变基线模块与本头执行同一独立探针:9组默认关闭HTTP 的完整JSON与正文hash相同,42组普通check_access 的返回值、异常类型和完整诊断逐项相同,包括固定/全登记选择、local/SSH、alias保留/移除、空值与非法Goal。没有归一化语义字段;随机端口和源码路径仅是未参与域响应比较的执行元数据。默认关闭时没有分析root、来源读取或provider。启用后的 warm-cache 新建/重试回归仍拒绝503/404,恢复来源后才执行。
来源transport和provider回应是合成的;HTTP、文件、job和进程生命周期是真实的。没有调用付费模型、实际SSH/container,未测试安装包或浏览器。测试第一次因三个错误路径未收集任何用例,已保留该诊断;按仓库实际路径执行的99项才是有效结果,不把空跑当通过。configured mypy 的17个文件通过,不冒称覆盖全部修改模块;修改的三个Python文件Ruff与实际编译通过。
语义与 CI 对齐
新 helper 复用现有Goal和cancel语义,没有新增Enum、持久化字段或广义actor协议。取消的来源准入变化有上述接受依据与两种反例,默认关闭及共享访问路径保持旧完整输出;机器执行的范围和身份约束没有被称作可忽略建议。
原生 standard premerge 的 6项直接检查和14项选中检查全部执行通过,包含词汇、维护性、catalog/risk与公共边界扫描;总门首次因前一头收据 quality_stale_receipt 保持失败。更重要的是,本头没有包含 #7351 的单独修复:必需完整 lint 范围在不可变base与本头均失败于 test_linked_goal_sources.py:23:5 的相同F401,完整stdout/stderr、argv、环境与配置摘要相同。该文件不在本PR改动中,99项测试和独立反例覆盖本PR的不变量,因此按当前评审政策独立归因为 pre_existing_unrelated,不要求本PR修改无关代码。
这个红检查仍是必需失败,没有改为optional、删断言或绕过门禁。精确质量收据 cqr_01244f0ee12f3888fe31 明确 FAIL,物理全部字段已核,strict verify不通过,合并资格保持hold;这里没有声称总premerge通过。作者另披露的全仓benchmark/release失败未在本轮重跑,保留为作者来源,不冒独立资格。当前配置不查询、轮询或等待GitHub CI。
我的整体评价
对 2ffc25e152b44dceea3a12a75fd38164627342b8 的取消修复:APPROVE,未发现本PR新增阻断。long_horizon与user_experience均为improved,含义是既有本机作业能够通过原owner停止,而非证明模型科学质量、长期效果或完整费用收益。
沿用现有HTTP namespace/请求验证与工具包的pack、key、既有job和进程所有权,仅从GoalSource已有访问校验中提取固定范围检查;取消不再依赖实时来源,其他调用仍检查连接。 交付既有取消通路的有界修复;来源事实读、重试、进程生命周期与持久化owner仍归原实现,不建立第二个provider或权限体系。
生产改动与实际缺陷相称,保留纯scope提取和原生命周期owner,不需更大框架、语言迁移或人为后继任务。批准与质量/合并资格分别处理:必需F401、CQR FAIL和未测试的实际transport/安装范围都继续可见;维护者整合单独修复后需重新限定新精确头,不能继承旧头资格。本次没有合并、安装或启动真实分析。
English verdict: APPROVE — 2ffc25e152b44dceea3a12a75fd38164627342b8 fixes existing local-job cancellation after source outage or removed membership while retaining namespace/Goal/pack/key/job identity and fresh start/retry admission. Two immutable-base HTTP/process regressions fail503/404; all99 head tests pass. Nine full disabled HTTP responses and42 complete access outcomes match. The identical pre-existing required F401 remains red on base/head: exact CQR cqr_01244f0ee12f3888fe31 is FAIL and merge qualification stays held. Synthetic transport/provider tests do not qualify real SSH, installed/browser behavior or model quality.
|
Qualification readback for English: The exact-head review/thread gate is ready, with CI not consulted. Required F401 and strict CQR FAIL remain separate repository merge holds; integrating #7351 requires qualification of the resulting new head. This approval does not authorize merging. |
Goal And Delivered Outcome
An already-running local trajectory analysis could not be cancelled from the standalone RuntimeWorkspace once its original source became unreachable or stopped registering the Goal. The cancel endpoint refreshed source membership before reaching the existing local cancellation mechanism, leaving the provider child running.
This change admits cancellation against the prepared source selection and the existing local job identity. Starting and retrying analysis still require a fresh source read and current registered membership.
main; reviewed baseline2b72d30fca7f452a71dffb723ebf6d1e2e878484.Author Declaration
docs/reference/trajectory-assessment.mdat that revision.RuntimeWorkspaceHandler._research_analysis_scope; extractedGoalSource.check_scopetest_source_analysis_cancel_does_not_require_live_source, unavailable-source and removed-membership casestest_source_analysis_offline_cancel_requires_pinned_job_identityregistered_status(..., fresh=True)for POSTScope And Continuation
Complete within this scope. The existing cancellation owner, provider lifecycle and source-backed execution contract are retained.
check_accessdelegates its existing fixed-selection validation tocheck_scopeand continues to check current connection access for its existing callers.Source factual GET reads still require the source. The regression reconnects before checking the persisted
cancelledreceipt; it does not claim offline browsing of source facts. No successor is required for this repair.Validation
2ffc25e152b44dceea3a12a75fd38164627342b8; its source tree is identical to the locally validated tree.finished.synthetic.The branch was rebased onto
b95223532af1cc3cc6bd9558f96750c79f581e1b; the only intervening main change is an unrelatedteam-evidence.mjsbrowser test. All fix file blobs are unchanged. The key offline-cancel/identity regressions (3 passed) were rerun after the rebase. Broader checks below were run on the same fix files over the earlier reviewed baseline; they were not rerun solely for that unrelated test change.test_research_analysis_api.py,test_runtime_workspace.py,test_goal_source.py,test_linked_goal_sources.py,test_trajectory_assessment.pyandtest_trajectory_assessment_store.py; actual HTTP handler, local pack/job storage and synthetic child processes.git diff --check. No paired RFC changed.python examples/control_plane/cli-output-budget-regression-smoke.py.loopx check --scan-path loopx/ --scan-path tests/ --scan-path examples/ --scan-path docs/completed; it reports 43 non-literal credential-reference warnings, with no blocking scan error.explore_history_rowsimport intests/presentation/test_linked_goal_sources.py:23. The changed Python files pass.benchmark/tests/test_native_checkpoint.py::test_interrupted_cursor_requires_exact_unreleased_final_guard[None-legacy]fails identically on clean main and this branch. The remainder was not run.loopx canary premerge --from-git-diff --git-diff-base origin/main --fail-fast, standard tier: direct checks, 5 catalog canaries, 8 risk-profile smokes and the changed-path public-boundary scan passed.All synthetic runs used
LOOPX_USAGE_PING=0. No real SSH/container source, paid model, native Windows runtime, installed package or browser was used. The focused HTTP/process checks cover the changed cancellation path and its rejection boundaries; the repository-wide failures above remain visible for review.Initial GitHub CI
DCO Sign-off passed. The branch's kernel-static-checks fails on the same unused
explore_history_rowsimport as the exact base's own CI. Dependent test/merge summary gates therefore fail or skip; this PR does not claim a green full CI run.The release build also reaches the existing
smoke:chat-model-menuassertion and fails to rendergoal-only-model. The base smoke suppliesselectedAgentModelReadback, while the base ChannelHeader does not consume it. Both inputs are unchanged by this PR. This baseline attribution follows the immutable source and the SSR failure; a separate exact-base release-build rerun was not performed. These repository baseline failures remain outstanding.Frontend / Visual Evidence
none. The existing endpoint's admission behavior changes; no UI component, layout, label or control changes.nonefor visual evidence.Type / Area
Bug fix, regression tests and contract clarification. RuntimeWorkspace source admission and trajectory-analysis presentation adapter; no new provider/job owner or domain authority.
Shared-authority RFC fixture impact
N/A: no canonical-store routing, authority promotion, compatibility projection or TypeScript control-plane migration changes.
Boundary Checklist
Signed-off-bytrailer.