Repository navigation
perf(collaboration): batch guarded inventory observations - #7630
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
|
This pull request has merge conflicts with Choose the remote for the base repository, not an out-of-date fork. git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEADFor a same-repository clone whose Keep the DCO |
…ource identity Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; runtime_reported; reasoning_effort=max
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
独立整项审查:cdb5f3fbecb6ead202c410e1914758347f6e2a70;不可变 base:a36e01c32b0a290a96466c766629a0b01850f823。
动机 / Motivation
在原会话查看大量已委派请求的用户,需要读到完整问题、当前进展和历史,并能在来源不可用后恢复查看。
过去每条历史请求都单独取得 Goal 生命周期保护并读取 receipt;一次查看 25 条请求要重复 25 次,列表越长,重复读取越多。当前按最多 12 条组成批次,仍保留每条请求自己的锁,并在返回内容前重新核验来源。
本次可验证的结果是:同一原始状态下完整 HTTP 响应保持一致,25 条请求的 receipt 事务和生命周期保护均从 25 次降至 3 次,25 个请求锁全部保留。
本 PR 只优化已有请求列表的读取,不改变授权、未完成判断、历史内容、修改或取消入口,也不以读取列表代替接收方采用或结果返回。
剩余缺口是已安装应用中的持续时延、内存和完整任务成本收益;既有 loaded-range 刷新工作仍由 #7663 负责,这些不能由事务次数下降推定完成。
改动思路 / Approach
机制留在现有 source inventory 和 HTTP owner:复用已有批量 receipt 读取,按顺序持有对应请求锁,释放全部生命周期与请求锁之后再读取 Core work。来源身份的重复纯计算仅在一次 HTTP 读取内、完整 Session 字段完全相同时复用;入口与出口仍分别执行实际授权观察。
不改会保留按历史行数增长的重复事务;只缓存第一次授权或长期保存列表会引入过期内容;一次锁住全部历史则会延长对 Goal writer 的排斥。当前最多一页的批次提供了可回滚的边界。失败批次按现有规则隔离,单条 receipt 失败会继续核验其余条目,不能将缺失当作已完成。
批量 IO、派生展示与授权决策各自仍使用原 owner;没有新增配置、第二个状态账本或 TypeScript 决策规则的 Python 副本。当前 PR 的边界是既有公开 HTTP 读取链路上的批处理、独立失败恢复与来源复查。
具体改动 / Changes
完整读取四个路径,+401/-68:两个生产文件、一个现有测试模块与 capability README。生产变化集中在 inventory 的请求分组、锁与 receipt 批次,以及 HTTP 的纯 Session 分类复用。没有 frontend/Lark/CLI 新操作或响应 schema 变更;原会话入口继续消费同一响应。
- read_conversation_requests:来源发现之后,每批重新取得对应 Goal lifetime;逐条重读原 Session、Turn、grant 与 typed lifecycle。Core linked-work IO 位于所有锁之外,最后仍使用原排序、搜索、分页与 snapshot digest。
- _locked_request_batch / _read_receipt_batch:按请求身份及路径排序,保留 exact/legacy 锁位置;批量 receipt 观察期间持有每个相关请求锁。批量读取出错时逐行调用原 owner,单条失败不会吞掉健康邻居。
- _request_inventory_read:分类键包含完整来源 Session JSON;相同 id 的字段变化也必须重算。缓存不跨 HTTP 请求,不能绕过最后的 provider、Goal visibility 或 Core scope 复查。
规范依据为 loopx/capabilities/manager_context/README.md,spec_revision:a36e01c32b0a290a96466c766629a0b01850f823,使用本次修改前的约束作为 oracle。逐项映射:original Session 的私有来源、host 与授权重查保持;receipt 的请求版本一致性保持;coverage 中不可读不等于无待办,健康内容可保留并恢复;Core work 在生命周期保护外读取,列表不执行 ACK、采用、修改、取消或返回。新增 README 解释这些既有边界,不能自证实现正确。
对主干的风险 / Risks
未发现当前阻塞性问题。独立冻结 harness 在同一组真实 File/SQLite canonical 状态上,分别启动不可变 base 和当前 head 的实际 HTTP server。每种后端包含 25 个请求、33 个无关 Turn、两名接收方和长中文问题,逐项比较 16 组完整响应,包括历史分页、搜索、非法输入、外部来源拒绝、单锁不可用、单 receipt 不可用及恢复。仅将展示时钟作为两边相同的 fixture;没有删除或归一化响应字段,完整内容、digest、计数、错误和恢复结果一致,原始来源与协作 receipt 字节不变。
两边都保留 25 个请求锁;base 的 25 次 receipt/Goal guard 在当前变为 3 次。冻结的 13 条请求反例在 base 的 File/SQLite 上均因 13 次而非 2 次保护失败,当前对应测试通过,说明检查能发现旧工作量。实际 IO owner 仍执行,成功结果未由 mock 提供。这只证明事务工作量下降,没有测量已安装应用的时延、锁等待分布、内存或总体效率。
五个完整相关模块的 109 个不同用例已获通过证据。首次为 90 PASS/19 FAIL,19 个失败均在未修改的 native 启动 provider 校验;不可变 base 与当前 head 的同一用例在相同外部覆盖下报相同异常,相关四个 source/fixture 文件逐字一致。只在测试子进程移除该覆盖后,完整 native 入口模块 24 PASS,覆盖全部 19 个失败及 provider/binding/scope 撤销与恢复。首次失败保留,不能把它们记成最初即通过。
自建 parity harness 的前两轮也保留:先因未完成无关 fixture Turn 而在读列表前拒绝,后因比较了不同的展示时钟而失败;修正 fixture 生命周期与冻结展示时钟后,原完整响应断言通过。产品代码、断言及生产恢复规则均未为测试变绿而修改。
focused Ruff、Python compile、四项 diff/双语直接检查及当前完整 standard 的 15 项 selected 全部 PASS。首次完整 standard 的 semantic 检查在120.112s超时;随后相同120s限制下,不可变 base 为93.709s PASS,当前 head 独立复查为52.593s PASS,当前完整 standard 复查亦全部通过。未修改预算、断言、产品或 fixture 来消除该超时,也未证明首次超时根因或持续稳定性。当前判断结合109个来源用例、32组完整 HTTP 对比、实际失败恢复、基线反例和两次当前 semantic 完成证据,不能仅选择最后一次绿灯。当前分支提交的 DCO trailers 均有效。
没有新增枚举、义务、provider 缓存或 prose 分类。来源字段变化、替换 Goal lifetime、scope 撤销和冲突 receipt 的内容隔离均有当前测试;没有以“相同 Session id”或“已激活 Goal”推导更大权限。真实 PostgreSQL store 未变,不能把作者历史 PG 结果冒充本次 exact-head 运行。按当前策略未查询、轮询或等待 CI,合并许可与 readiness 仍单独判断。
我的整体评价 / Verdict
APPROVE 这个 justified_increment。long_horizon 为 preserved:完整来源、原请求版本、未完成义务、历史和失败恢复仍可读,缩减重复事务没有变成跨请求授权缓存。user_experience 为 improved:用户沿现有原会话列表直接得到相同完整结果,无需新增配置、重填上下文或确认回合。复用、批次上限与错误隔离发生在原 owner,机制与已有长列表问题相称。
视觉审阅不适用:检查的 conversation_inventory.py 与 request_control_api.py 只改变读取工作,未修改渲染页面或可见响应内容。未验证已安装应用的页面阅读质量、持续时延、内存、真实模型采用或完整成本净收益。作者截图与历史性能描述均未转作本次独立验证。
English verdict: APPROVE — cdb5f3f. The existing HTTP journey preserves complete responses, authority and recovery while reducing receipt transactions; installed latency and overall efficiency remain unqualified.
huangruiteng
left a comment
There was a problem hiding this comment.
Reviewer: model_agent | OpenAI | owner-delegated exact-head approval
动机 / Motivation
Long delegation inventories repeatedly crossed the Python/TypeScript receipt boundary for each request. The reviewed change batches existing typed receipt observations while retaining every request lock, fresh source/Goal authority checks, complete original questions, and per-row failure recovery. The user-visible outcome is the same inventory response with bounded repeated work rather than a new capability or response contract.
改动思路 / Approach
Reuse the existing inventory transaction and response owner. The PR preserves each request lock, performs at most one page per guarded batch, releases lifetime/request guards before linked Core-work reads, and keeps source-route discovery, guarded observation and unlocked projection separate. A failed batch receives one read-only fallback pass so a failed row is reported unreadable without hiding healthy neighbors or converting missing evidence into completion.
具体改动 / Changes
The authored change remains four files: the collaboration inventory reader, the HTTP request-control adapter, its existing test module, and the manager-context README. Current main was integrated after the prior review; the resulting PR tree is ecd8ab8df2711a63d231121dd68ef3d779f0cf18, exactly matching the locally tested d9622f4474505789f163329909de000a0ebab13a + cdb5f3fb integration tree.
对主干的风险 / Risks
No new blocking finding was found in the current integration. On the combined tree, the new inventory test module passed 32/32, and the five-file inventory/request-control/native-ingress/source-authority selection passed 100/100. Focused Ruff and Python compilation passed, and the diff has no whitespace errors.
The PR's Windows job reports four self-update assertion failures that also occur on current main; they are base-equivalent and outside the changed files. Three manager-inspection turn timeouts occur in unchanged manager/chat-runtime code and are recorded separately as Windows instability rather than evidence that the inventory invariant failed. Installed latency, p95, memory, production adoption and all long-running remote shards remain unqualified.
我的整体评价 / Verdict
APPROVE. Exact head: 5c2c5c87c9f6e48b256475ab4b41b5212d310af5. The change is a bounded, reversible work-count reduction on the existing inventory journey, and current-main integration preserves its authority, failure-isolation and response invariants. The separate installed-performance and unrelated Windows CI limitations are not claimed as resolved.
English verdict: APPROVE — current-main integration preserves the reviewed batching and recovery semantics; the exact integrated tree passed the relevant 100-test selection and focused static checks.
Problem And Result
Opening or searching a long delegation inventory repeatedly crosses the Python/TypeScript receipt boundary for individual requests. This proposal reads existing typed receipt and agenda facts in bounded batches while retaining complete original questions, truthful coverage and fresh authority checks.
receipt_statestransaction for at most one page of the same exact Goal lifetime. Acquire every corresponding request lock in deterministic order and retain it until receipt and return observations are captured.The final synthetic File/SQLite qualification checks 43 receipt transactions → 4, retaining 43 request locks, 4 lifetime fences and 2 fresh provider observations per read. This is a work-count reduction. Installed latency and p95 remain unqualified.
Author Declaration And Scope
Written by: model_agent — OpenAI Codex. Specification: existing manager-context capability and typed collaboration lifecycle. Tested commit:
cdb5f3fbecb6ead202c410e1914758347f6e2a70. Target/base snapshot:main/a36e01c32b0a290a96466c766629a0b01850f823; four files, 401 insertions / 68 deletions against that target. No installation or production-process attachment.The local helpers serve the active inventory reader only. One safe-fix pass moved existing pre-lock route discovery after the maintainability ratchet detected an oversized decision function; the final source passes without raising a limit or adding an exception. The TypeScript receipt/unfinished-state owner remains unchanged.
Validation
cqr_0edbc19cb670a5217f3f, exact scope0edbc19cb670a5217f3f0f669b06cc7778474425f4a06d2eb9d060e38e8d2218; zero blockers, two retained warnings, one safe-fix pass. Quick premerge passes six direct checks, three catalog canaries and the public scan, with the exact receipt verified. Self-merge authority remains false.The first current-source test attempt inherited an incompatible optional provider selection: 129 passed and 19 native-fixture setup cases failed before inventory execution. A child-only default-fixture environment rerun passed; after the discovery extraction the complete final 148-case run passes. The production provider check is unchanged. The initial maintainability failure and its final passing rerun are retained as distinct source results.
Previous-head evidence remains historical: 193 selected tests; the 19-test source CLI/host continuation journey; real isolated PostgreSQL 16.15 378 store + 11 service tests, zero skips; the earlier native and built-frontend suites. PostgreSQL store/service code is unchanged and that suite was not rerun for this Python reader increment. Historical evidence is not relabeled as a final-head rerun or requester adoption.
Visual Evidence
UI composition is unchanged, so one current view is reused instead of manufacturing identical before/after images. These are synthetic captures of the actual built frontend and final backend, not the installed App. The primary question is which original requests still need follow-up and who owns them: recipient groups, compact request/state rows and one sticky count answer it; briefs, linked work and original messages remain on demand. Desktop and the full 43-row narrow list stay scannable; expanded original content remains complete at 390px with the existing 14px body type. No new explanation or control is added.
A real fixture 503 withholds rows, footer and numeric count; Retry restores them. Source failure removes the delegation entry until original-source recovery. App history briefly timed out during concurrent validation and recovered; this increment does not claim to resolve that broader history delay. The disposable fixture's first teardown also raced an owned worker; the final harness retires and reaps its authenticated children before deleting the temp runtime. No shared worker is stopped.
Descriptive Timing Limits
The earlier receipt-batch candidate, before the discovery-only extraction, was compared with its immutable preceding inventory using the same API: 80 serial ABBA/BAAB responses, four samples per mode/query/provider, fixed synthetic 100ms provider observation. Other host load and OS cache are uncontrolled; no CPU profile is part of these samples. They are not final-head, cold-runtime, installed or p95 qualification.
Median milliseconds, base / batch candidate:
Improvement is not uniform: SQLite unfinished/refresh and File history medians regress. File unfinished maximum rises 1666 → 3340ms and refresh 2028 → 2560ms; SQLite unfinished maximum rises 1338 → 1726ms, pagination 1282 → 1675ms, and refresh 1107 → 1144ms. Previous-head negative samples, including File maxima 2277 → 2876ms and 3746 → 4008ms, remain historical limits. No overall speedup or tail improvement is claimed.
CI And Remaining Delivery
The previous exact head
85b5620da66372f9fc26764f51edce52185109effailed its Windows batch: 415 passed, 20 skipped, four updater assertions failed. The separate #7675 fixture proposal reached 417 passed, 20 skipped, two manager-inspection timeouts in its native Windows batch. Its earlier updater assertions disappear there, but the workflow still fails; the inspection cause remains unqualified.The prior dashboard shard failed one loaded-lens sample at 1275ms against the frozen 1000ms limit; the other samples were approximately 583/699/804/753ms. The limit is retained. A matched reproduction is still needed before attributing or fixing that failure. None of these results qualifies the new head or complete CI.
Original historical handoff proof, real requester adoption and actual original-route result return, installed first-content/whole-list/tail latency, required CI and independent review remain open. #7663 owns the separate loaded-range refresh proposal. This completed author increment is independently testable and reversible; it does not complete the overall delegation task or grant merge/install authority.