Skip to content

Coalesce Oracle token estimate updates#376

Open
baron wants to merge 1 commit into
mainfrom
wt/oracle-token-estimate-coalescing
Open

Coalesce Oracle token estimate updates#376
baron wants to merge 1 commit into
mainfrom
wt/oracle-token-estimate-coalescing

Conversation

@baron

@baron baron commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Coalesce Oracle upcoming-input token estimate work instead of canceling/restarting every update.
  • Snapshot the latest compose/conversation state after a short coalescing delay.
  • Use the prompt view model's cached token total so the passive "Next msg" estimate no longer rebuilds full chat context/clipboard during typing or restore bursts.

Notes

  • This intentionally trades some estimate precision for responsiveness when the chat preset's resolved context differs from the composer cached total, especially git-inclusion cases.
  • No tests were added: Fable 5 review called out that testing this private UI-label coalescing path would require disproportionate refactoring.

Validation

  • swiftformat --config .swiftformat Sources/RepoPrompt/Features/Chat/ViewModels/Oracle/OracleViewModel.swift
  • make dev-swift-build PRODUCT=RepoPrompt
  • swiftformat --config .swiftformat --lint Sources/RepoPrompt/Features/Chat/ViewModels/Oracle/OracleViewModel.swift
  • swiftlint lint --strict --config .swiftlint.yml Sources/RepoPrompt/Features/Chat/ViewModels/Oracle/OracleViewModel.swift
  • .agents/skills/rpce-contribution-check/scripts/preflight.sh commit
  • .agents/skills/rpce-contribution-check/scripts/preflight.sh push

Review

  • Claude Code Fable 5 (claudeCode:claude-fable-5) performed a final read-only minimization review and recommended GO after trimming redundant defensive cancellation machinery.

@provencher

Copy link
Copy Markdown
Collaborator

Actually oracle token counting isnt really used anywhere. We should just remove this altogether. it made sense in the IDE mode chat in classic to show the token count there. Here we dont really need this.

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.

2 participants