Skip to content

fix: auto-index mid-size exec output for ctx_search without intent#991

Open
niemst wants to merge 1 commit into
mksglu:nextfrom
niemst:fix/auto-index-next
Open

fix: auto-index mid-size exec output for ctx_search without intent#991
niemst wants to merge 1 commit into
mksglu:nextfrom
niemst:fix/auto-index-next

Conversation

@niemst

@niemst niemst commented Jul 23, 2026

Copy link
Copy Markdown

What / Why / How

ctx_execute / ctx_execute_file output between 5 KB and 100 KB was returned raw inline but never indexed — the gap between the 5 KB intent threshold and the 100 KB pointer threshold — so a later ctx_search could not find it. Index that range into the FTS5 content KB as a side effect at the 5 KB threshold while still returning stdout inline; the intent search and >100 KB pointer paths are unchanged. Each exec gets a distinct source label (execute:<lang>:<hash> / file:<path>:<hash>) so successive execs don't clobber each other's index.

Affected platforms

  • All platforms

(core exec/index path in src/server.ts — platform-agnostic)

Test plan

Added a regression test in tests/core/server.test.ts: a ~6 KB no-intent ctx_execute returns raw inline and is retrievable via search. npm test green (one pre-existing macOS-locale test unrelated to this change), npm run typecheck clean, npm run build passes (tsc + bundle + assert-bundle + assert-asymmetric-drift).

Checklist

  • Tests added/updated (TDD: red → green)
  • npm test passes
  • npm run typecheck passes
  • Docs updated if needed — n/a
  • No Windows path regressions (forward slashes only)
  • Targets next branch

ctx_execute/ctx_execute_file output between 5KB and 100KB was returned raw
inline but never indexed, so a later ctx_search could not find it. Index it
as a side effect at the 5KB threshold while still returning stdout inline;
intent and >100KB pointer paths unchanged. Distinct per-call source labels
(execute:<lang>:<hash>) so successive execs don't clobber each other.
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