Skip to content

perf: stop scanning stale session markers (#153) - #171

Open
dajiaohuang wants to merge 1 commit into
ayghri:mainfrom
dajiaohuang:perf/153-context-scans
Open

perf: stop scanning stale session markers (#153)#171
dajiaohuang wants to merge 1 commit into
ayghri:mainfrom
dajiaohuang:perf/153-context-scans

Conversation

@dajiaohuang

Copy link
Copy Markdown

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

  • Human-authored
  • Autonomous agent-authored
  • Hybrid

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

  • The change does not access or expose secrets, private files, or unrelated user/repository data.
  • Scripts, hooks, workflows, and evals are bounded and do not create surprising or irreversible side effects.
  • No destructive, privileged, production, externally visible, or persistent action occurs without explicit user intent and appropriate safeguards.
  • Network access, third-party code, permissions, and provider costs are minimized and documented.
  • Prompt text, examples, and fixtures contain no hidden instructions that weaken safety or expand agent authority.

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

  • This is not a breaking change.
  • This is a breaking change; it was discussed, and migration/deprecation documentation is included below.
  • Canonical and mirrored skill files are synchronized when applicable.
  • Relevant platform manifests and installation documentation were reviewed.

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 with FileNotFoundError: [WinError 2], reproduced on upstream main.
  • 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

  • I reviewed the complete diff, removed unrelated generated changes, and take responsibility for the submitted content.
  • All failed, skipped, or unrun checks are disclosed above.

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.

1 participant