Merged
Conversation
Design for moving per-engine token-usage extraction into each engine's own package, slimming tokenstat down to a thin orchestrator (scheduling, DB I/O, retry budget, tombstone, legacy fallback chain). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
10-task TDD plan that incrementally migrates per-engine token-usage extraction into each engine package and slims tokenstat down to a thin orchestrator. Each task keeps the build green; old and new code paths coexist until the final cleanup task. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…(stubs) Introduces ai.TokenUsage, ai.ErrSessionDataNotFound, and extends EngineAdapter with CollectTokenUsage; all four adapters and test stubs implement it as a no-op returning ErrSessionDataNotFound. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nd test mocks Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move Kimi token-usage extraction into internal/ai/kimi/ with Collector/NewCollector/NewCollectorAt, wiring it into kimiAdapter.CollectTokenUsage. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… app Replace parser-based Syncer with adapter-based dispatch; wire engines map and fallback order from app.go into the new NewSyncer signature. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eAdapter map Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…i.NewCollectorAt - Drop redundant storeUsages passthrough; call upsertRows directly - Promote tombstoneUsages to package-level var (avoid per-call alloc) - Simplify syncSession/tryAdapter doc comments (remove bullet lists) - Remove redundant collectSQL field comment - Add NewCollectorAt test seam to pi.Collector for consistency with kimi/codex Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ine tombstone Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Package sessionfile is a shared file I/O utility, not an engine implementation. Relocating it to internal/utils/ removes it from the ai/ hierarchy and breaks the reverse dependency on the ai package by replacing ai.ErrSessionDataNotFound with stdlib fs.ErrNotExist. Engine callers remain responsible for wrapping the error into domain terms at their own boundary. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
OPENBEE_URL is now injected via os.Setenv at server startup and inherited by subprocesses through os.Environ(), matching the optional env-var semantics of OPENBEE_API_KEY. Removes the explicit openbeeURL parameter from EngineConfig, NewAdapter, NewInvoker, and BuildBaseEnv across all four engine packages. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…on and openbee url refactor Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
No description provided.