Skip to content

fix(core-agent): account for image context tokens - #29

Open
CloudTianTian wants to merge 1 commit into
Orkas-AI:mainfrom
CloudTianTian:fix/image-token-estimation
Open

fix(core-agent): account for image context tokens#29
CloudTianTian wants to merge 1 commit into
Orkas-AI:mainfrom
CloudTianTian:fix/image-token-estimation

Conversation

@CloudTianTian

Copy link
Copy Markdown
Contributor

Summary

  • count image content blocks in the shared session token estimator instead of pricing them at zero
  • let image-heavy tool turns reach the active-checkpoint threshold before provider context overflow
  • cover both direct token estimates and checkpoint triggering with regression tests

Source: Orkas commit f2c1c42d83f7b2914a247c6906adbe0ce35bfa57, adapted onto the current OrkasOpen main branch.

Testing

  • npm run typecheck
  • node scripts/run-tests.mjs run src/core-agent/test/session.test.ts — 76 passed
  • node scripts/run-tests.mjs run src/core-agent/test — 32 files / 680 tests passed
  • git diff --check
  • selective OSS postcheck: no forbidden symbols/files, provider/API changes, orphan imports, UI/package violations, or TypeScript/renderer syntax failures

Local baseline limitations

  • full npm test: 503 files / 7,371 tests passed; 3 environment-dependent tests failed because the local checkout lacks the OfficeCLI host binary and the existing video fixture tries to create /Users/userWorkSpace
  • npm run test:resources could not start because the system Python does not have pytest installed
  • the selective OSS postcheck still reports the pre-existing builtin-resource hash drift and full-sync coverage backlog; neither is changed by this two-file PR

Count image blocks in the shared session estimator so image-heavy tool turns trigger checkpointing before context overflow. Add regression coverage for direct estimates and the active-checkpoint threshold.
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