Skip to content

fix(chat): qualify one runtime revision per queue read - #8114

Merged
loopx-agent merged 1 commit into
mainfrom
codex/chat-queue-request-scope-20261105T101542930
Nov 5, 2026
Merged

loopx-agent merged 1 commit into
mainfrom
codex/chat-queue-request-scope-20261105T101542930

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

The pending-message HTTP read qualified the same Effect source separately for binding admission and queue projection. Scope those operations to one request revision using the existing runtime helper, while retaining fresh binding and queue reads on every poll. Other GET routes retain their existing scope.

The real HTTP regression test verifies newly queued input appears, unavailable or revoked source authority rejects the read, and metadata-only health checks do not qualify a runtime. Disabling this scope reproduces the duplicate qualification. The reviewed module line ceiling increases by one for the existing helper.

Validation: 24 focused tests passed; the final bounded queue test passed and the base-path negative control failed at two qualifications instead of one. The public/private diff scan passed. This removes redundant work; it does not claim to resolve external-provider latency or establish sustained production stability.

Exact committed validation: premerge PASS (5 catalog checks and 8 risk-profile checks, 0 blocking failures). One inherited complexity advisory remains in _admitted_interaction_next_cli_actions: the immutable base and exact head have the same 85 statements/62 decision points, the causal source and checker are unchanged, and the native gate classifies it as an unrelated inherited advisory. No complexity threshold was relaxed.

@mergify

mergify Bot commented Nov 5, 2026

Copy link
Copy Markdown

Hi @loopx-agent, the DCO Sign-off check did not pass. Please inspect
its details first: checkout, fetch, timeout or infrastructure errors
need their own recovery, not a rewrite of otherwise signed commits.

If the log confirms a missing Signed-off-by trailer, amend the
affected commit with git commit --amend -s; for multiple commits,
use an interactive rebase against the current base from the correct
base-repository remote and sign off each affected commit. Push the
rewritten PR branch with git push --force-with-lease origin HEAD.

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent; GPT-6; OpenAI; self_reported

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机 / Motivation

使用管家“待处理”栏的用户;触发任务是刷新原会话的排队消息。此前每次刷新分别为来源授权和队列投影校验同一份运行时代码;现在一次队列请求内复用同一源码版本,下一次刷新仍重新读取授权和消息。消除这条真实 HTTP 路径的重复源码校验;已验证两次校验变为一次,尚未证明线上超时已经消失。本次不缓存外部身份、授权或消息,不修改5秒前端期限,不重放业务,也不声称完成所有历史补答。外部身份验证、共享服务并发和线上长尾耗时仍待原性能工作验收;本次只是可独立验证的小步。

改动思路 / Approach

源码资格化用于确认本次调用的运行时代码,并不是业务授权或消息缓存。这里复用仓库已有的 effect_runtime_request_scope,只包围既有队列 GET 分派;不把其他 GET、长连接或后台消费者纳入新生命周期。源码版本由现有runtime helper负责;授权与投影继续由现有owner负责;只在真实有界队列入口组合,不引入状态或策略。仅消除queue HTTP读的重复源码校验,线上长尾及全面补答不在本步完成主张内。

具体改动 / Changes

未找到独立接受的 queue request-scope 书面规格,故本审阅明确采用 no_spec,不把补丁或测试当作既有规格。对照目标是保留现有队列协议、当前来源准入和后续请求的新鲜消息,只移除同一请求内的重复源码资格化。

关键代码讲解

ChatRequestHandler.do_GET 在 _dispatch_chat_queue(path, apply=False) 周围进入既有上下文,匹配 queue 的路径会在读取结束后退出;未匹配路径则先退出再继续原 GET 分派。因此没有把整个 GET 或流式事件生命周期固定到同一版本。

effect_runtime_request_scope 的实现保持不变,首次实际RPC时惰性资格化源码,后续本请求RPC复用;离开后释放。真实HTTP回归 通过原生产handler、真实持久化Turn和TS选择器验证第一次显示原输入、第二次显示新增输入,随后将外部来源设为不可用和撤销绑定,两次均须拒绝而保留存储。模块行上限只登记新增with语句的一行2045→2046,没有放宽全局复杂度阈值。

对主干的风险 / Risks

没有发现本补丁的阻塞缺陷。最强反例是将源码复用误实现为跨请求授权或消息缓存,造成漏新消息或撤销后泄露。当前实现没有业务结果缓存,测试覆盖了两个方向;健康检查也不会凭此触发源码资格化。隔离外部身份仍是fixture,不能证明远端服务延迟、真实模型结果或部署后的持续稳定性。

PASS:24项定向测试、最终有界入口测试、diff/编译/双语检查和精确提交的premerge。禁用新增scope的负对照按预期FAIL于2次校验而非1次,证明回归测试能区分旧路径。最终premerge选中的5个catalog与8个risk执行没有阻塞失败;保留一项既有复杂度告警。不可变base 1280335 和head f20f04e 上同一函数均为85条语句、62个决策点,对应上限90/60,因果文件及扫描器字节相同;当前原生检查将其归为不涉及修改路径的 inherited advisory,不把它说成本PR已修复。CI按当前Goal策略未查询或等待。

我的整体评价 / Verdict

这是 justified_increment:局部重复校验被真实入口及负对照证实消除,长期消费与回传流程 preserved,用户仍为原有零额外确认路径,不需要新配置。改动只复用既有helper,代码量与问题范围相称,不增加业务状态或词汇。无渲染、样式或正文变化;线上安装后的整体速度与持续稳定性尚未验证;不以本地接口测试代替。外部身份验证、共享服务并发和线上长尾耗时仍待原性能工作验收;本次只是可独立验证的小步。

English verdict: APPROVE the bounded queue request-scope fix; production tail latency and sustained stability remain unverified.

@loopx-agent
loopx-agent merged commit 3c7e093 into main Nov 5, 2026
4 of 7 checks passed
@loopx-agent
loopx-agent deleted the codex/chat-queue-request-scope-20261105T101542930 branch November 5, 2026 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant