Skip to content

perf(codex): skip recall for control-only prompts - #3881

Open
AirHua-byte wants to merge 1 commit into
volcengine:mainfrom
AirHua-byte:codex/control-prompt-short-circuit
Open

perf(codex): skip recall for control-only prompts#3881
AirHua-byte wants to merge 1 commit into
volcengine:mainfrom
AirHua-byte:codex/control-prompt-short-circuit

Conversation

@AirHua-byte

Copy link
Copy Markdown

Description

Skips automatic recall for strict control-only Codex prompts such as a bare acknowledgement, continue/status request, or fingerprinted approval. Classification is deterministic and happens before any recall HTTP request; prompts carrying task details continue through the existing recall path.

Human Involvement

  • A human participated in the implementation or review loop
  • This PR was generated entirely by AI agents without human participation in the loop

Related Issue

Part of #3686

Type of Change

  • New feature (non-breaking change)
  • Documentation update
  • Performance improvement
  • Test update

Changes Made

  • Add a conservative control-prompt classifier with task-detail fallthrough.
  • Short-circuit before recall network work and expose an opt-out setting.
  • Cover acknowledgements, continuation/status prompts, approval fingerprints, false-positive boundaries, and disabled behavior.

Testing

  • Added focused tests

  • Targeted tests pass locally

  • Tested on macOS

  • node --test scripts/auto-recall.test.mjs — 12 passed.

  • Real-hook A/B, 15 repeats: false-injection rate 0.75 → 0.50; P50 1840 ms → 31 ms; P95 2885 ms → 2114 ms; injected-token P95 3238 → 2934; strict comparison passed.

Checklist

  • Code follows the project's style
  • Self-review completed
  • Documentation updated
  • No new warnings

Additional Notes

The classifier intentionally avoids semantic inference. Any prompt with task-specific content falls through to normal recall.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant