perf: stop scanning stale session markers (#153) - #171
Open
dajiaohuang wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Address the session/history scan portion of issue #153. State restoration and context-marker lookup now walk from the newest entry backwards and stop at the first relevant marker, avoiding traversal of stale history while preserving the existing latest-marker semantics. A compatibility check covers the short-circuit behavior.
This is a focused first increment for #153; it does not claim to implement the issue's broader evaluation parallelism, context-size, or persistent-index proposals.
Authorship and provenance — select exactly one
Agent/tool and model/version: Codex (model/version not exposed in this session).
Agent contribution: Reviewed the performance analysis, selected the smallest behavior-preserving scan optimization, implemented it, added a short-circuit check, and ran the checks below.
Human verification: The submitting user authorized direct submission and reviewed the requested scope. The complete diff was reviewed by the agent; no independent human test execution is claimed.
Known limitations or uncertain results: No provider-backed benchmark was run, so this PR makes no quantified latency claim. The remaining performance proposals require separate acceptance criteria and measurement.
Labels
Target label: Target:Integrations
Author label: Author:AI
Workflow labels: enhancement
Safety and side effects
Side effects, permissions, network access, and cost: None. The changes alter only traversal order and stop once the newest relevant state marker is found; output semantics remain unchanged.
Compatibility
Migration or rollback notes: None. If no relevant marker exists, both functions retain their previous default state.
Verification
python -m unittest discover -s tests -v— 39 passed; 4 existing Windows eval-runner tests fail withFileNotFoundError: [WinError 2], reproduced on upstreammain.python scripts/run_evals.py validate— passed.bun scripts/check_context_compat.ts— passed.git diff --check— passed.Behavior evals: Not run; this is an internal traversal optimization with no response-rule change.
Final accountability