Skip to content

fix(chat): reject invalid calendar Task input before source lookup - #7681

Merged
huangruiteng merged 2 commits into
mainfrom
codex/managed-task-journey-20261029
Oct 29, 2026
Merged

huangruiteng merged 2 commits into
mainfrom
codex/managed-task-journey-20261029

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

A periodic session-task request with a missing or malformed Task source reached source lookup before configuration validation. Normal Goal settings preview/apply returned HTTP 500 and a generic error, despite the existing normalizer having a precise refusal.

  • Outcome basis: repair that reproduced API defect and provide a repeatable packaged fixture for the existing managed Session calendar Task path.
  • Goal/source and gap: ordinary calendar Task acceptance already exists; the settings descriptor currently omits task, so the packaged editor still cannot configure the complete Task declaration.
  • Before → after: six malformed-input cases fail with HTTP 500 on f2990e3de; they now return typed HTTP 400 with the existing source requirement. Both command-injection controls remain rejected. Failed requests perform no model work, configuration write, calendar enrollment or conversation mutation.
  • Intended base: main. This slice does not complete the parent unified Task UI or natural-language creation work.

Author Declaration

  • Written by: model_agent — OpenAI Codex, GPT-family model.
  • Specification and revision: the scoped defect and fixture contract above; existing calendar contract in periodic reports at f2990e3de.

Implemented against

Criterion Disposition Symbol / path Test or command
Reject malformed Task declarations before source access implemented _goal_capability_options, loopx/chat_goal_configuration_api.py File/SQLite preview and apply regressions
Keep valid/default configuration behavior unchanged implemented existing periodic-report normalizer five complete response pairs per backend match the baseline implementation
Reproduce an original Session Task through real native storage implemented steward_report_fixture.py --managed-calendar-task file|sqlite isolated File/SQLite HTTP, native Turn, artifact and conversation readback
Target the fixture's returned local Session actor implemented shared managed fixture preparation finite --managed-session and calendar routes use the returned Session's actor
Complete Task source picker and natural-language creation deferred existing configuration descriptor/editor and Task creation work documented as unfinished; this API repair does not supply those surfaces
  • Self-check: read all four changed files and the validation outcomes below. No live business messages, private audio, production failed windows or account changes were replayed for this repair.

Scope And Continuation

The production change reuses the existing configuration normalizer at the HTTP boundary, before the Session source guard. It adds no schema, scheduler, worker, permission or Task authority. The fixture adds real File/SQLite calendar configuration and stopping/restarting its existing wake owner; it also corrects the local Session actor correlation and avoids starting the private outbound owner for local-only journeys.

The independent boundary is malformed-input handling plus an honest reproducible fixture. The existing descriptor/editor still drops or rejects the task field; its product owner must complete that interface and the broader natural-language journey. The guide now records that gap instead of claiming JSON editing is sufficient.

Validation

  • Tested revision: 77ced11aa8427b9b79bf0dcf76dd44214ccac213.
  • Run state: finished.
  • Input classes: synthetic, public_fixture.
Check kind Result Evidence / limitation
static passed Ruff on the three changed Python files; compileall; diff hygiene and public-boundary scan
unit passed 71 calendar Task tests; 44 adjacent configuration and descriptor tests
regression_parity passed baseline six malformed cases fail, two injection controls pass; File/SQLite valid/default/report/Task/clear responses remain equal in five response pairs per backend
real_entrypoint passed packaged Chat settings preview shows the typed source refusal; future disabled fixtures start no Task work
real_backend passed disposable native File and SQLite stores: one due artifact computes 42, commits and returns once to the same original Core Session; stopping/restarting the existing wake service does not repeat that period; pause retains the result
real_entrypoint passed finite local Task HTTP submission uses the same returned Session actor and commits one independently checked result
real_entrypoint passed freshly built wheel: eight malformed-input HTTP cases on File/SQLite; all loaded LoopX modules come from the isolated installation
integration passed exact-head native standard premerge gate: 11 selected checks, no failures or manual holds; Chat bundle built and verified
manual passed compiled UI at 1200 pixels and 390 pixels; specific refusal remains readable with no horizontal document overflow; original result read back through the packaged conversation

The 71/44 suites and live fixture work ran before rebasing onto 58205c62a16a9e98ab3319ada3bab5aea74b829d; the four scoped files were byte-identical afterward. The exact-head premerge, wheel HTTP regressions and refreshed screenshots ran after the rebase. The final fixture Session-actor correction was independently exercised for File, SQLite and finite local submission. The initial wheel build refused stale frontend assets; a fresh Chat build and a new wheel succeeded. A first observation timed out before the existing wake cache elapsed; later independent readback proved that original execution completed once, without replay.

These checks qualify deterministic storage, scheduling and HTTP mechanics with a synthetic app-server. They do not qualify live-model interpretation, natural production deadlines, full Chat process restart, account switching, or the unfinished complete Task settings/natural-language UI. PostgreSQL is not affected or promoted by this change.

Frontend / Visual Evidence

UI impact: changed error text through the existing renderer; no frontend component or layout change. Synthetic public fixture, before f2990e3de, after exact head above. No persistent hosted preview; run the documented --managed-calendar-task sqlite fixture for a disposable local preview.

After, desktop:

Specific Task source refusal in packaged settings

Before, desktop:

Generic server failure before validation

After, 390-pixel viewport:

Complete source refusal at a narrow viewport

Attention/craft review: the existing error region gives the missing-source reason beside the preview controls. No new cards, colors, visual hierarchy or interaction were introduced. The full source-picker gap remains explicit.

Type of Change

  • Bug fix
  • Documentation update
  • Test update

LoopX Area

  • Host or runtime integration
  • Capability or extension
  • Public docs or presentation surface

Technical Direction

Operator surface and IM integration: existing managed local Session Task path.

Shared-authority RFC fixture impact

N/A: no shared-authority migration, runtime routing or compatibility projection changes. File and SQLite are exercised through their existing native owners.

Boundary Checklist

  • Diff, body and attachments contain only public-safe synthetic data; no private traces, credentials, internal links or machine paths.
  • No duplicate benchmark work.
  • Scoped API repair and fixture; parent acceptance remains open.
  • No paired RFC changed; native bilingual premerge check passed.
  • Before/after visual evidence supplied.
  • Both commits include DCO sign-offs.

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 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; reasoning_effort=max

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

动机 / Motivation

没有发现阻塞本次范围的缺陷。使用 Goal 设置预览周期 Task 的用户。缺少 Task 来源的同一草稿,修改前得到通用服务器错误,修改后得到明确的 HTTP 400 来源要求;两者均不应执行业务。无效输入在读取 Session 来源前被拒绝,合法与清空配置继续使用原事务。本 PR 不完成 Task 来源选择器、自然语言创建、正式部署或账号自动切换。通用编辑器仍未登记 task 字段,完整界面尚不可用。 准确错误提示减少无效预览,但不代表完整任务功能已经可用。

改动思路 / Approach

输入校验属于既有配置不变量,应复用周期配置 normalizer;Task、唤醒与回传仍由原 native owner 执行。当前边界是 HTTP 错误修复及可复现的隔离场景,完整编辑器由既有产品配置工作接续。 原路径先进入来源 guard,再由写入者校验;缺失来源可能先抛出内部错误。现在复用 pure normalizer 提前拒绝,随后仍走原来源 guard、expected revision、写入与独立读回。没有第二套验证规则、调度器、状态表或自动重试。猜测旧来源会改变显式意图,新建独立 runner 则会割裂已有真实调用路径,这两条替代方案均不合适。

具体改动 / Changes

关键代码讲解

  1. _goal_capability_options 保留提前返回的 clear 分支,在周期配置分支复用 normalize_configuration。HTTP update 在来源 guard 前调用它,故无效输入不能先进入原 Task 读取或写入。
  2. normalize_configuration 未改逻辑,仍要求明确来源、日历和原 Session,同时禁止安装命令。这里修复执行顺序,没有建立新权限。
  3. fixture main 使用返回的本地 Session actor,增加 File/SQLite 模式,并停止、恢复既有 wake owner。局部旅程不启动无关 private outbound owner;默认原报告旅程仍保留该消费者。

依据 docs/product/periodic-reports.md 的不可变 revision f2990e3de49d6aa7441e0e0b739f49bfc84aae38:completed-source 已实现,来源须属于原 Agent、已完成且有独立 argv 验证。no-command-install 已实现,八项 HTTP 拒绝及无副作用验证覆盖。existing-goal-transaction 已实现,真实 preview/apply/readback 与两种存储均被调用。goal-settings-editor 延期:原编辑器完备性表述不成立,文档明确指出字段缺失;既有产品配置工作仍须补来源选择与自然语言入口。没有通过改写指南把该缺口变成完成。

对主干的风险 / Risks

最强反例是 normalizer 单元测试通过,但 HTTP 仍先进入来源 guard;另一个反例是 fixture 验证了另一个准备 Session 的结果。实际 HTTP、File/SQLite 原 Task 和原会话读回分别排除了这些问题。基线六个 malformed cases 失败、两个注入控制拒绝;当前安装包八项全部 PASS。合法 default/report/Task/clear 的五组完整响应在每种存储上与基线相同。到期 Task 分别产生一次 42、native commit、正确 actor 与保留历史;wake 停止恢复不重放,暂停保留结果。有限 Task 入口也使用返回的正确 Session。

71 项日历与 44 项相邻测试在 rebase 前运行,四个范围文件之后字节不变。当前 head 又通过 native standard premerge、fresh Chat/wheel build 和安装包回归,1206 个加载模块没有逃回源码目录。初次过期 bundle 拒绝、错误构建 cwd 和早于 wake cache 的观察超时均保留,没有改称首次通过。模型为合成 app-server,HTTP 与存储真实;这些证据不证明完整 Chat 进程重启、真实模型理解或正式部署。按 wait_for_ci=false 未查询或等待 CI;实际 CQR 为 disabled,没有虚构收据。

我的整体评价 / Verdict

这是 justified_increment。long_horizon=preserved:原 Task 生命周期、失败保留及 once-only 恢复仍归既有 owner。user_experience=improved:桌面错误区域直接显示缺少来源的原因,390 像素下完整提示可读;未增加卡片、交互轮次或改写布局。 本次改变的是无需展开的错误区域;JSON 配置作为代表性输入上下文,不增加报告或列表展开状态。 未验证范围:完整来源选择器与自然语言配置未完成;截图不证明正式部署或真实模型理解。 没有新增人工确认轮次;HTTP 调用者可以纠正输入,完整编辑器仍不能产生声明。输入校验属于既有配置不变量,应复用周期配置 normalizer;Task、唤醒与回传仍由原 native owner 执行。当前边界是 HTTP 错误修复及可复现的隔离场景,完整编辑器由既有产品配置工作接续。 生产只复用现有校验,无兼容版本枝、迁移或新状态,额外工作集中在可重用 fixture 与诚实交付说明,成本与复现问题相称。共享语义判断为 reuse_existing,没有新增语义族。批准只针对当前 head 的 API/fixture,父任务保持未完成,合并与安装仍需实际读回。

English verdict: APPROVE — 77ced11; shared early Task validation fixes the reproduced HTTP failure. Native File/SQLite, installed-wheel regressions, parity and exact-head checks pass; full UI and production adoption remain separate.

@huangruiteng
huangruiteng merged commit 5c2ed9f into main Oct 29, 2026
9 of 11 checks passed
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.

2 participants