Skip to content

fix(runtime): cache auto-compact threshold within run#15

Merged
wynxing merged 47 commits into
mainfrom
codex/issue-294-auto-compact-threshold
Apr 16, 2026
Merged

fix(runtime): cache auto-compact threshold within run#15
wynxing merged 47 commits into
mainfrom
codex/issue-294-auto-compact-threshold

Conversation

@fennoai

@fennoai fennoai Bot commented Apr 15, 2026

Copy link
Copy Markdown

Requested by @Yumiue

Summary

  • Cache implicit auto-compact threshold resolution per run to avoid repeated resolver/catalog lookups in hot path.
  • Recompute threshold only when provider/model/auto_compact key changes.
  • Extract helper methods to simplify run flow while keeping behavior unchanged.
  • Add runtime tests for cache hit and cache-key-change recomputation.

Cai-Tang-www and others added 30 commits April 14, 2026 23:38
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: Cai-Tang-www <106404101+Cai-Tang-www@users.noreply.github.com>
Generated with [codeagent](https://github.com/qbox/codeagent)

Co-authored-by: Cai-Tang-www <106404101+Cai-Tang-www@users.noreply.github.com>
Generated with [codeagent](https://github.com/qbox/codeagent)

Co-authored-by: Cai-Tang-www <106404101+Cai-Tang-www@users.noreply.github.com>
Generated with [codeagent](https://github.com/qbox/codeagent)

Co-authored-by: Cai-Tang-www <106404101+Cai-Tang-www@users.noreply.github.com>
…ling

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: phantom5099 <245659304+phantom5099@users.noreply.github.com>
…t output contract

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: Cai-Tang-www <106404101+Cai-Tang-www@users.noreply.github.com>
- Narrow resolveNoProgressStreakLimit param from config.Config to config.RuntimeConfig
- Store resolved noProgressStreakLimit in turnSnapshot to ensure reminder injection
  and termination checks use the same value, eliminating concurrent-reload inconsistency
- TrimSpace systemPrompt once before appending self-healing reminder
- Merge double lock sections into one in the progress evidence path
- Expand TestRuntimeConfigValidate to cover 0, -1, -99 rejection cases
- Update docs: concrete limit-1/limit examples (default 2nd/3rd turn)

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: phantom5099 <245659304+phantom5099@users.noreply.github.com>
fix(runtime,config): resolve review feedback for streak handling
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: Cai-Tang-www <106404101+Cai-Tang-www@users.noreply.github.com>
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: Cai-Tang-www <106404101+Cai-Tang-www@users.noreply.github.com>
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: Cai-Tang-www <106404101+Cai-Tang-www@users.noreply.github.com>
…y bounds

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: Cai-Tang-www <106404101+Cai-Tang-www@users.noreply.github.com>
feat(runtime):增加可修改死循环次数以及自我纠正提示
实现控制面底层 IPC 传输从“裸 MessageFrame”向“标准 JSON-RPC 2.0”的直接无缝切换,硬化内部契约,为后续 Runtime 接入奠定稳定基座。

主要改动:
1. 协议归一化:新增 JSON-RPC 解析层,使用 json.RawMessage 延迟解析 params,并统一收敛至内部 MessageFrame 进行路由。
2. 错误模型重构:采用标准 JSON-RPC 错误码 (error.code),并将网关业务错误码统一映射至 error.data.gateway_code。
3. 适配器升级:url-dispatch 全面切换为 JSON-RPC 收发,并补齐了严密的 RequestID/Action 响应关联校验。
4. 稳定性增强:修复 URL 调度器的 context 取消中断逻辑(防止无界阻塞),并修复 Windows 环境下的绝对路径越界检测漏洞。
5. 测试覆盖:大幅增补 Server/Dispatcher 协议回归单测,网关核心覆盖率达 95.3%。
feat(): 实现 SubAgent WorkerRuntime 与角色策略(1024XEngineer#274
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: phantom5099 <245659304+phantom5099@users.noreply.github.com>
- block Windows drive-relative review paths across platforms
- ensure JSON-RPC error responses keep id field (null when unknown)
- strengthen dispatcher success-case RPC envelope assertions

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: pionxe <148670367+pionxe@users.noreply.github.com>
- 将 Validate 中 MaxRepeatCycleStreak 判断由 < 0 回退为 <= 0,与
  ApplyDefaults / resolveRepeatCycleStreakLimit / 内联兜底三处保持一致
- 在 TestRuntimeConfigApplyDefaults 补充负值回退测试(-1 被替换为默认值)
- 在 TestRuntimeConfigValidate 将有效测试入参从 0 改为 1,并将 0 纳入
  无效值覆盖列表,覆盖 <= 0 分支
- 在 TestRepeatCycleStreakStopsRunAndInjectsReminder 补充
  EventStopReasonDecided 事件断言(StopReasonError + detail 字段),
  与 TestProgressStreakStopsRun 保持对称覆盖

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: phantom5099 <245659304+phantom5099@users.noreply.github.com>
fix(runtime): 修复编译错误并补齐重复循环回归测试
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: phantom5099 <245659304+phantom5099@users.noreply.github.com>
feat(context): 接入 session 级 skills 注入并修正 runtime 降级语义
…lization

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: Yumiue <188874804+Yumiue@users.noreply.github.com>
…ool-result-projection

fix(context): 修复 metadata-only 工具结果语义丢失
creatang and others added 15 commits April 15, 2026 17:14
- fix image attachment send path metadata composition and cache invalidation
- secure clipboard temp file creation with unique names
- optimize image mime detection using header reads
- expose Ctrl+V in full help and add targeted tests

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: creatang <165447160+creatang@users.noreply.github.com>
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: creatang <165447160+creatang@users.noreply.github.com>
…er-fix

test(tui): improve multimodal and session-switch coverage
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: pionxe <148670367+pionxe@users.noreply.github.com>
…-03-jsonrpc-hardening

feat: [EPIC-GW-03] 本地控制面契约硬化 (JSON-RPC 2.0 切换)
…ader-render-fix

feat(tui): Phase 8 多模态接入(图片/文件)+ Phase 9 会话切换(/session
- fallback when resolver returns zero/negative without error
- add regression tests for zero/negative resolver outputs
- align compact/config docs with implicit-threshold behavior

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: Yumiue <188874804+Yumiue@users.noreply.github.com>
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: phantom5099 <245659304+phantom5099@users.noreply.github.com>
fix(runtime): align repeat-cycle breaker semantics and tests
- cache derived auto compact threshold per run using provider/model/auto_compact key
- recompute only when key changes to avoid repeated resolver snapshot lookups in hot path
- simplify run flow by extracting session lock binding and self-healing prompt injection helpers
- add runtime tests for cache hit and key-change recompute behavior

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: Yumiue <188874804+Yumiue@users.noreply.github.com>
@wynxing wynxing merged commit 8928f03 into main Apr 16, 2026
1 check failed
@fennoai fennoai Bot deleted the codex/issue-294-auto-compact-threshold branch April 16, 2026 00:13
fennoai Bot pushed a commit that referenced this pull request Apr 16, 2026
…er-fix

test: increase coverage for config and tui app
fennoai Bot pushed a commit that referenced this pull request Apr 17, 2026
fix(capability): close review gaps and coverage
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.

7 participants