Skip to content

fix(context-pivot): clarify native no-history failures - #235

Merged
somewan820 merged 3 commits into
openpi-dev:mainfrom
627150795:fix/issue-24-context-pivot-error
Aug 29, 2026
Merged

somewan820 merged 3 commits into
openpi-dev:mainfrom
627150795:fix/issue-24-context-pivot-error

Conversation

@627150795

Copy link
Copy Markdown
Contributor

Problem

context_pivot can pass its minimum context threshold while native compaction still rejects the session with Nothing to compact (session too small). The current error is technically accurate but does not tell the user what to do next.

Value

Turn this native no-history failure into a clear, actionable message while preserving the existing behavior and messages for all other failures.

Approach

  • Translate only the exact native Nothing to compact (session too small) error.
  • Tell the user to continue in the current session or use /sessions to choose another session or start a new one.
  • Keep cleanup of pending pivot state and compaction state unchanged.
  • Add a focused regression test covering the translated error and the unchanged generic-error path.

Related to #24

Validation

  • node --test --experimental-strip-types tests/extensions/context-pivot/index.test.ts — 4/4 passed
  • bun run lint — passed
  • bun run typecheck — passed; existing file-search Effect warnings remain outside this change
  • git diff upstream/main...HEAD --check — passed

Impact

No persisted data, native compaction semantics, or unrelated extension behavior changes.

Compatibility

Existing successful pivots and other errors retain their current behavior.

@627150795

Copy link
Copy Markdown
Contributor Author

Synchronized with the latest upstream main. Focused context-pivot tests pass 4/4, along with lint, typecheck, and diff checks. The PR is mergeable and awaits maintainer review/workflow approval.

@627150795

Copy link
Copy Markdown
Contributor Author

补充代码审计结果:已修复 headless 模式的失败可见性缺口。context-pivot 针对性测试 5/5,lint/typecheck 通过;PR 当前仍保持 open,等待维护者审核。

@627150795

Copy link
Copy Markdown
Contributor Author

代码有效性审计结论:PR #235 的 native Nothing to compact (session too small) 错误映射确实能在 UI/headless 路径被触发,并能清理 pending/compacting 状态;但 Issue #24 的根因仍未消失:context usage 达到 30k 后仍可能先返回 Context pivot started.,再由 native compaction 异步失败。当前 Pi 扩展 API 没有可查询的 native eligibility,因此本 PR应继续标记为“错误可见性子修复”,不宣称消除了 false-positive。

@627150795
627150795 force-pushed the fix/issue-24-context-pivot-error branch from a36754b to 0096a78 Compare August 29, 2026 11:24

@somewan820 somewan820 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.

已完成静态审查。native no-history failure 的 UI/headless 映射保持既有 cleanup/state 行为,context-pivot 的相关路径与测试覆盖一致。未发现 P0-P2、死代码或明显测试缺口。未运行测试。

@somewan820
somewan820 force-pushed the fix/issue-24-context-pivot-error branch from 0096a78 to 09a8192 Compare August 29, 2026 12:35
@somewan820
somewan820 force-pushed the fix/issue-24-context-pivot-error branch from 09a8192 to d116f9a Compare August 29, 2026 12:46
@somewan820
somewan820 merged commit bb95552 into openpi-dev:main Aug 29, 2026
3 checks passed
agnitum2009 pushed a commit to agnitum2009/openpi that referenced this pull request Aug 29, 2026
* fix(context-pivot): clarify native no-history failures

* fix(context-pivot): report headless compaction failures

---------

Co-authored-by: QuinnWan <[email protected]>
(cherry picked from commit bb95552)
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