Skip to content

fix(chat): include ongoing resource tradeoffs in tool advice - #6737

Merged
loopx-agent merged 2 commits into
mainfrom
codex/chat-advice-resource-tradeoffs-20261017
Oct 17, 2026
Merged

loopx-agent merged 2 commits into
mainfrom
codex/chat-advice-resource-tradeoffs-20261017

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

Tool-selection advice could explain use cases and prerequisites while omitting the ongoing execution/scheduling budget and maintenance effort needed to choose a workflow. The common non-execution Chat prompt now asks for decision-relevant resource tradeoffs and material unknowns, without inventing prices or savings. CQ02 makes those existing cost expectations explicit.

  • Outcome basis: reproduced advice completeness gap; ordinary self-contained repair.
  • Intended base: main; no issue is closed by this scoped change.
  • Observable before → after: missing recurring-cost guidance → explicit default instruction. The new live-model outcome remains unverified; deterministic checks validate the source change only.

Author Declaration

  • Written by: model_agent — OpenAI Codex, GPT-6 family.

Implemented against

Criterion Disposition Symbol / path Check
Supported paths, costs and limits implemented at guidance layer loopx/chat_agent.py:_turn_prompt; CQ02 Diff inspection; existing Chat regression suite
Simpler path allowed; no assumed team/daemon; external services need a reason implemented, existing behavior retained Existing CQ02 row and Chat instructions Diff inspection; existing Chat regression suite
New candidate actually meets CQ02 through the native model and original reply deferred Existing community qualification workflow Requires candidate adoption and controlled native retest; not claimed here
  • Self-check: reviewed the owning common prompt, current public criterion and exact diff. Added no case-name routing, state, permission, transport or model-setting changes. No assertion-only prompt-string tests were added.

Scope And Continuation

  • Complete within this source-guidance scope: two shared prompt sentences and clarification of one existing golden row. Execution-mode instructions are unaffected.
  • Remaining work: exact-head review/CI, then controlled adoption and native CQ02 qualification in the existing community test workflow. The prior cost failure remains open. Source-read availability and other community qualification gaps are outside this patch.

Validation

  • Tested revision: c56f7fbccb9b9129b7ce4263b38da23dae245376.
  • Run state: finished.
  • Input classes: synthetic, public_fixture, authorized_private_read_only.
Check kind Result Public-safe evidence / limitation
unit passed Existing test_chat_agent, test_chat_ordinary_project, test_chat_response_parsing, test_chat_codex_context: 373 passed; same Python diff before commit
static passed Ruff for changed Python; configured mypy scope; changed-file public-boundary scan; diff and bilingual-RFC checks
integration passed Standard loopx canary premerge --from-git-diff: six direct checks, eleven selected checks, zero failures/advisories
real_entrypoint failed Pre-change native Chat advice omitted recurring costs despite covering prerequisites; original delivery independently read back. Private evidence retained locally
real_backend not_run New prompt has not been installed or invoked through the native model; unit/canary success is not a semantic fix claim
  • Coverage and gaps: prompt construction, ordinary/project Chat regression paths and selected repository canaries passed. New-candidate repeated model qualification and remote CI are still required before a behavior/adoption claim.

Frontend / Visual Evidence

  • UI impact: none. No layout, chrome or visual-state change; screenshots and attention/craft review are N/A.
  • Source data: none.

Type of Change

  • Bug fix
  • Documentation update

LoopX Area

  • Host or runtime integration
  • Public docs or presentation surface

Technical Direction

  • Operator surface and IM integration; existing community CQ02 acceptance.

Shared-authority RFC fixture impact

N/A: no shared-authority protocol, routing, persistence or promotion change.

Boundary Checklist

  • Diff and description exclude private state, credentials, raw traces, verifier output, internal links and local machine paths.
  • No duplicated maintainer-owned benchmark work.
  • Scoped to the reproduced advice gap and existing criterion.
  • No paired RFC changed; local bilingual gate passed.
  • UI impact marked none.
  • Every branch commit has a DCO sign-off.

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

@songoow songoow left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

动机

这条改动要解决的是 LoopX Chat 在“该用哪个工具/工作流”这类咨询上给出不完整取舍的问题。受影响的是向 LoopX Chat 咨询“该用哪个工具/工作流”的普通使用者:他们此前拿到的建议会讲清用途和前置条件,却可能完全不提搭建与维护投入、持续执行或调度成本,导致在自建与现成工具之间做出信息不完整的取舍。改动前,同一段工具选择请求在 Chat 中可能只得到功能与前置条件说明;改动后,非执行态的公共提示词明确要求给出决策相关的搭建/维护投入、持续执行或调度开销与限制,并在缺少证据时说明未知项而不是编造价格。可观测结果是所有复用 _turn_prompt 的 Chat 宿主(chat_agent、chat_dsh、chat_providers、chat_acp)在非执行态都会带上这段取舍要求,而执行态提示词逐字节保持不变。本 PR 不引入价格数据源、不改变任何执行态提示词、不新增状态/权限/传输或模型配置,也不声称新的原生模型回答已经通过 CQ02 验收。新提示词尚未通过原生模型针对 CQ02 做受控复测;该验收仍留在既有社区资格测试流程,由后续受控采用步骤完成。不合并的代价是:用户继续在缺少持续成本信息的情况下挑选工作流,事后才发现维护或调度开销远超预期,而这一缺口只能靠用户自己反复追问才能补齐。

改动思路

做法是在既有的公共提示词构造器 _turn_prompt 的非执行分支里补两句关于取舍的要求,而不是新增一个提示词所有者或一个成本数据服务。控制流很直接:宿主适配层把用户消息与运行标志交给 _turn_prompt,该函数按 execution_mode / project_work / direct_work 组合角色、限制与仓库读取指令,返回一整段系统提示;新加的两句只在 execution_mode 为假时拼接,因此执行态提示词保持原样。这段取舍要求属于既有提示词构造器里的本地措辞,由唯一 _turn_prompt 所有者承载并被各宿主复用;没有新增决策拥有者、状态或对外契约,因此不需要进一步简化或拆分。本 PR 的交付边界是源侧提示词与 CQ02 验收行同步;原生模型复测与采用证据作为后续步骤保留在社区资格流程,理由是该步骤需要受控环境而不是本补丁的源码范围。

所有权边界没有变化:loopx/chat_dsh.py、loopx/chat_providers.py、loopx/chat_acp.py 都是从 loopx.chat_agent 导入 _turn_prompt,所以这一处修改覆盖了这些宿主,而不需要各自复制一份措辞。替代方案是把成本口径做成结构化配置或接一个价格数据源,但那会引入本问题不需要的持久状态与外部依赖;本 PR 选择让模型在缺少证据时明确说明未知项,符合“不编造价格或节省额”的边界。

具体改动

语义上只有两处改动,合计 +3/-1 行。其一在 loopx/chat_agent.py 的 _turn_prompt(第 539-540 行)非执行分支末尾新增两句:要求在做工具/工作流建议时说明决策相关的搭建与维护投入、持续执行或调度成本与限制,并要求把取舍落在可用证据上、把重要未知项讲清楚而不是编造价格或节省额。其二在 docs/product/use-cases/community/golden-queries.md 的 CQ02 验收行中把“costs and limits”扩写为包含搭建/维护投入与持续执行/调度成本、且不得编造价格或节省额,使既有公开验收描述与新提示词一致。

关键符号映射:loopx/chat_agent.py:539 的 _turn_prompt 是本仓库唯一的 Chat 系统提示构造器,负责把角色、限制、仓库读取与工具建议要求拼成一段提示;它的 execution_mode 参数决定是否进入“已确认任务执行”分支。loopx/chat_dsh.py:36、loopx/chat_providers.py:17、loopx/chat_acp.py:22 从该模块导入,构成实际消费者链路,因此单点修改即可覆盖多个宿主。golden-queries.md:105 的 CQ02 行是公开验收描述,评审者据此判断建议是否完整。

规格依据:docs/product/use-cases/community/golden-queries.md,审查修订 f9bdae67596c185cebc81dc555dd6a3e0242e9c5。验收判据 CQ02 要求把需求映射到受支持路径、成本与限制,并能推荐更简单的路径、不假设每个任务都需要团队或常驻守护进程、提出外部服务时必须给出具体理由;本 PR 在指引层实现该判据,并把“新候选通过原生模型与原始回复满足 CQ02”的复测作为受控后续步骤。一个具体例子:用户问“我主要想跟踪开源项目、定期整理资料,偶尔修代码,哪些部分适合 LoopX”,改动前系统提示只要求讲清用途与前置条件,改动后同一请求要求同时给出维护投入与持续调度开销,并允许回答“具体价格未知”。

对主干的风险

这段改动属于系统提示措辞,风险集中在“模型是否照做”和“是否影响执行态”。我实测了两侧:非执行态普通请求的提示长度从 13419 增至 13690(恰好是这两句 271 个字符),执行态提示在基线与 head 逐字节相同(均为 8935 字符,diff 无差异),说明任务执行回合的指令没有漂移。负向链路同样成立:当 execution_mode=True 时新句子不会出现,因此“已确认任务执行”不受这条取舍要求约束;project_work 与 direct_work 仍走非执行分支,会带上该要求,这与它们都属于“非执行态建议/工作”的定位一致。

兼容性与权限方面没有变化:不新增字段、状态、CLI 参数或协议标识,不改动 protected_action、context_handoff 或任何权限判定;这段文字是建议性引导而非机器强制约束,忽略它不会改变任何门禁结果,只会让建议重新变得不完整,最终由 CQ02 这类社区资格验收暴露。残余风险是真实的语义效果尚未验证:作者明确标注原生模型复测 not_run,我的本地证据也只覆盖提示词构造与既有 Chat 回归(346 passed),因此“模型会稳定给出成本取舍”这一主张仍属未证实,需要在既有社区资格流程里做受控复测。

我的整体评价

交付判断是 justified_increment:本 PR 交付了一个可直接验证的增量(非执行态建议必须覆盖成本与未知项,执行态逐字节不变,公开验收行同步),剩余缺口是新提示词尚未经过原生模型的 CQ02 复测。没有阻塞性发现:改动规模与问题相称,没有引入价格数据源、第二套提示词所有者或新的权限面,且明确要求“不确定就说未知”,避免了编造成本这一常见失败模式。

我实际执行的验证:在受审查 head 的工作树上直接调用 _turn_prompt 对比三种分支(普通非执行态从 13419 增至 13690 且包含新句子;执行态 8935 与基线逐字节相同;project_work 同样带上新句子);python -m pytest tests/test_chat_agent.py tests/test_chat_ordinary_project.py → 346 passed;grep 确认 chat_dsh、chat_providers、chat_acp 均从 loopx.chat_agent 导入 _turn_prompt,不存在需要同步的第二份提示词。审查 head:c56f7fbccb9b9129b7ce4263b38da23dae245376。

Reviewer: model_agent, model DeepSeek Flash, provider DeepSeek, self_reported.

English verdict: APPROVE - c56f7fb: two-line non-execution prompt clause plus the CQ02 acceptance row add cost/maintenance tradeoff guidance while the execution-mode prompt stays byte-identical; 346 chat tests pass and no second prompt owner exists. Native CQ02 model qualification remains deferred.

@loopx-agent
loopx-agent merged commit a9443ce into main Oct 17, 2026
4 of 6 checks passed
@loopx-agent
loopx-agent deleted the codex/chat-advice-resource-tradeoffs-20261017 branch October 17, 2026 13:53
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