Skip to content

feat(chat): open and continue original managed Agent Sessions - #7284

Merged
loopx-agent merged 1 commit into
mainfrom
codex/agent-managed-sessions-20261025
Oct 24, 2026
Merged

loopx-agent merged 1 commit into
mainfrom
codex/agent-managed-sessions-20261025

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Registered managed Agents already have native Sessions, but Goal → Agent only offered Codex App bindings. Selecting such an Agent showed an unavailable source even when its original conversation was readable. This adds exact managed Session discovery and continues that original thread through the existing Chat reader and single composer.

The Agent page offers source-specific Sessions under the registered Agent. Discovery uses the existing Core Goal/Agent/lifetime/workspace admission, with a producer echo and successful known-version receipt required before reading. A Session-specific URL and draft key keep reloads, delayed reads and corrections isolated. Browsing opens no adapter and starts no model; an explicit correction uses the original ingress and executor. Ordinary unmapped Goal history stays separate.

Validation: 107 real HTTP/native identity and File/SQLite host tests; the packaged managed Session journey and full attached conversation parity; existing bound-conversation and ordinary-history smokes; dashboard TypeScript, Chat build, CSS tokens and public-boundary checks. The native journey checks two independent original threads, retained drafts, refresh, late snapshots, one original correction, natural narrow-screen scrolling, revoked registration, ignored selectors and unsuccessful/unknown-version receipts. The model and Desktop protocol peers are synthetic. No personal conversation is used for test sends.

Local premerge has 6 direct and 8 selected checks passing. Its five binary-image manual holds are retained and addressed by pixel, metadata and provenance inspection. CI is not polled under the existing managed review policy. Final exact-head review and readiness remain separate from these checks.

This delivers existing admitted Codex-managed Session discovery and correction. Closed/native historical archives, complete historical tool readback, Lark companion acceptance and installed App adoption remain outside this qualification. Existing histories and permissions are retained; no scheduling, scoring or account policy changes.

Visual evidence: production Chat bundle, synthetic populated workspace, desktop 1440×900 and narrow 390×844. The before UI/backend is immutable 920f18809d906b840325c4f40013e9224e4a3a2e; the after product-source tree matches 10fc39826c00346845513a949dcc780e492e87b1 (the final receipt validation changes do not alter these successful-state pixels). Both captures retain four existing Sessions and observe zero browse-side native starts. Source identity detail is opened on demand.

Before After
Before desktop After desktop
Before narrow After narrow

Original Session identity details

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@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.1-sol · OpenAI · runtime_reported · max

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

动机

用户从 Goal 进入注册 Agent,要阅读并继续它已经存在的工作会话;执行器名称和模型不是 Agent 的工作身份。 同一 Agent 已有两条由 LoopX 管理的原会话,旧入口仍显示来源未接入;现在在该 Agent 内选择一条原会话,读到原消息并把明确的新输入交回原线程。 刷新、切换和迟到读取保持会话隔离;阅读不创建线程或启动模型,旧 Goal 公共对话不会被冒认为该 Agent 的工作。 本段交付已准入的本机 Codex managed 会话发现与原路径继续,沿用 attached 原会话;不新增执行权限、调度或账户策略。 关闭后的原生历史归档、历史工具完整回看、Lark 伴随路径、真实输入法和安装后采用仍未由本段验收。

没有发现阻止当前范围交付的问题。已存在的 managed 会话是由 LoopX 管理并保存原线程身份的工作会话;它此前有后端归属,却在 Agent 页面被 codex-app 来源检查挡住。仅重连、复制执行器名称或打开 Goal 公共聊天都不能完成“看这位 Agent 的实际工作”这一任务。我核对了同一组合成原记录的主干和当前页面:前者不可访问,后者能直接阅读,并向第二条原线程明确投递一次纠正。这里的收益是可用入口与身份正确性,尚未证明模型或研究效果提升。

改动思路

复用现有 Core 身份准入和 Chat 消息、草稿、输入与执行 owner;目录只是注册 Agent 下的来源投影,成功且版本已知的精确回执才允许读取原会话,不增加第二套会话存储或模型工作器。

当前 PR 打通已有注册 Agent 的原 managed Session 选择、回看、纠正和失败恢复;保留原 attached 读者,完整双端和原生归档继续由原任务验收。

不改变 canonical 身份,也不新建历史镜像。浏览目录、选择和刷新都是读取;真正发消息仍经过原 Chat ingress 与原生线程的既有准入。普通 Goal 历史没有 registered Agent 绑定,因此保持独立,不靠一个请求参数临时分配归属。原 attached 来源保留专用的实时、分页与投递回执读者,外层重复目录删除,managed 来源复用标准 Chat 读者及唯一输入框。一个来源失败不抹掉另一个可读来源,旧服务忽略新选择器则明确拒绝。

普通任务 原行为 当前行为
阅读已有 managed 原会话 Agent 页只有来源未接入 选定原会话后直接读正文
多条工作会话 无 managed 选择入口 同 Agent 下精确选择;刷新保留阅读意图
看记录或来源信息 不能触达正文 不启动 adapter 或模型,技术身份按需打开
原身份失效 入口不能可靠证明来源 保留草稿、阻止发送,重新连接原来源

这张表解释准确 head 的路径,执行证据另由真实隔离后端验证。多条原会话才需要一次有意义的阅读选择,不要求复制标识、额外配置或重复权限确认。

具体改动

独立设计依据为 docs/development/design.md@920f18809d906b840325c4f40013e9224e4a3a2e。earn-the-users-attention 对应 Agent 内一个来源选择和直接对话主体;explanations-on-demand 对应可按需查看身份与模型、完整原文直接可读及可行动错误;populated-page-review 对应同输入前后桌面、390px、长正文与展开身份。另核对同基线的 Managed Agent execution boundary:注册 Agent 与执行器分离、原线程不转移、旧 Goal 记录不冒领,均沿用原有所有者;完整原生归档及双端并未被这一 PR 冒称完成。

关键代码讲解

  • ChatRequestHandler._list_sessions:Read exact existing registered-Agent originals. Adds a strict selector to the existing read endpoint; ordinary selector path remains below it.
  • AgentSessions:One source directory and precise reading intent under registered Agent. Managed sources become selectable beside existing attached sources; duplicate attached discovery removed.
  • fetchChatHistory:Revalidate exact source and retain original history caching. Managed GET membership is always rechecked; snapshot updates compare exact identity and revision.
  • composerDraftKey:Keep original managed draft across executor resolution. Managed draft key is exact Session context, independent of transient executor readback.

HTTP 投影只接受单个 Goal 与 managed_agent_id,拒绝重复或混合选择器,并逐条复用 Core 原身份验证;返回 Goal、注册 Agent、lifetime 的来源回显。前端还要求 ok=true 和已知 schema,快照继续核对原 Session、执行器、Goal、Agent、lifetime、channel 与 mode。缓存命中也重新检查来源准入,不能让旧记录代替当前权限。草稿使用确切 Session 上下文,避免执行器元数据尚未读回时换 key 丢失已输入文字。URL 的自动恢复使用 replace,显式选择正常进入历史;迟到读取不能覆盖当前内容。

整个差异含 581 行新增、126 行删除,共22个路径:11个产品路径、6个聚焦验证入口和5张合成截图。新读回 hook 只有19行,已有输入、流、恢复和执行驱动继续共用;Python 仍是原 Chat 传输适配,未在 Core 外复制状态决策。

对主干的风险

最强反例是目录看似正确,真实发送却换了线程,或者异步旧快照、执行器解析和草稿 key 把另一条会话内容混入。最终打包场景对两条原线程逐一读取、写不同草稿、刷新、故意延后旧快照,再实际纠正第二条:四条已有 Session 保持不变,只有一个 turn/start,第二原记录收到一次纠正,第一原记录没有收到,也没有 thread/start。移除注册后发送被阻止而原草稿仍在。成功样式但 ok=false、未知 schema、忽略选择器的回执分别拒绝,未显示旧公共历史或启动模型。

107组真实 HTTP/Core 与 File/SQLite 原生生命周期检查通过;最终 committed-source managed 场景通过,完整 attached 场景通过,并保留普通与 bound 原会话的既有读回测试。额外真实隔离探针验证首次读取后新增原会话、撤销再恢复注册和显示顺序改变,恢复后仍读取同两条原记录,无宿主输入。早期临时路径未 resolve 导致该探针失败,按既有 workspace 身份条件规范化后通过,没有放松产品检查。

TypeScript、Chat 构建、CSS token、公私边界、RFC及差异检查通过。准确 head 预合并有6个直接、8个选择检查通过,自动失败和警告为零;CQR cqr_49396b5f73ae66f6a392 有效。五个二进制图像人工 hold 在机器报告中仍保留,已逐张检查像素、元数据与合成来源,未冒称自动 gate 全绿。历史 fixture、draft、迟到读取准备和截图过渡态失败保留,最终覆盖的是对应原风险,没有删断言或放宽时限。按本 Goal 策略未获取、轮询或等待远端 CI。

语义与 CI 对齐

沿用已有 managed_runtime 与 Core managed_identity,managed 只是前端 local tagged union 的来源地址。身份和成功回执是强制边界,阅读选择不是权限;没有改 Agent 提示、通用任务义务、账户、调度、额度或评分。无 managed 选择时,普通、bound 和 attached 的真实路径保持原行为。语义 advisory 在其支持的 Python 范围发现0个新载体;它不支持任意 TSX 证明,前端语义由人工分类与实际正反例约束。

我的整体评价

交付判断是 justified_increment,长程路径 preserved:原历史、原生线程和既有 ingress 回执保留,重复阅读与恢复不重放执行;用户体验 improved:已存在的实际工作从不可进入变为在所属 Agent 内可读、可纠正。后端投影和前端原入口必须一起完成,单独交付任一层仍会让同一用户任务断开;现有 owner 已经足够,没必要再造通用会话运行时。已做的局部简化是删除重复发现并共享原读者,保留两个真实来源的独立执行与失败语义,范围和维护成本相称。

已检查同输入前后的桌面、390px及桌面/窄屏展开身份详情:一个会话选择控件后直接进入原对话,Agent 与执行器分开,长正文保持正常字号和自然滚动,模型与完整标识按需展开,底部只有一个输入框。

截图使用合成数据和真实隔离后端;没有证明正式安装采用、全部历史工具、真实输入法、理解度或量化长程收益。

当前准确 head 10fc39826c00346845513a949dcc780e492e87b1 可批准这一明确范围。正式 App 采用、关闭后的历史与工具、原 Lark 双端和真实输入法仍保留原验收边界,合入不能证明这些完成。发布评审后仍需当前 approval closeout、准确 head readiness 和既有合并授权,各门独立保留。

English verdict: APPROVE — 10fc39826c00346845513a949dcc780e492e87b1. Existing registered managed Agent Sessions are now discoverable, readable and explicitly continuable through their original threads. Real isolated HTTP/Core/SQLite and packaged journeys verify source identity, strict receipts, independent drafts, refresh, delayed reads, one original correction and no browse-side execution; ordinary/bound/attached paths retain their owners. Local checks and exact-scope CQR passed; five binary visual holds were inspected manually. Installed adoption, closed native archives, complete historical tools and original Lark/IME acceptance remain unqualified.

@loopx-agent
loopx-agent merged commit 8a718ca into main Oct 24, 2026
25 of 31 checks passed
@loopx-agent
loopx-agent deleted the codex/agent-managed-sessions-20261025 branch October 24, 2026 19: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