-
Notifications
You must be signed in to change notification settings - Fork 44
feat(extension): context usage donut and compaction #4283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
iscekic
wants to merge
18
commits into
main
Choose a base branch
from
extension-context-compaction
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
80fe7ee
feat(extension): parse gateway usage and model context length
iscekic 1db00b1
feat(extension): forward turn usage to callers
iscekic de2c3b0
feat(extension): keep drafts per conversation
iscekic 3017a63
feat(extension): close conversation tab without confirmation
iscekic 01e4036
feat(extension): show context usage donut in footer
iscekic f416496
feat(extension): add manual and automatic context compaction
iscekic d937464
fix(extension): block send while a conversation is compacting
iscekic c635f6e
test(extension): cover context donut, compaction, drafts, tab close
iscekic 0dc265f
fix(extension): satisfy lint and typecheck in new e2e tests
iscekic ef82d7c
style(extension): apply oxfmt to new context files
iscekic da2a010
refactor(extension): drop unused compaction abort param, document com…
iscekic 18f5a9d
fix(extension): trust side-panel sender by extension origin
iscekic 0f7d123
test(extension): make context-usage e2e robust to compaction timing
iscekic 15b017c
style(extension): use a block comment for the stored-auth queryFn note
iscekic 6233aac
ci(extension): run verify, build, and e2e on extension changes
iscekic f1ad780
fix(extension): make manual Compact now work for short conversations
iscekic 68a0c95
fix(extension): manual compaction summarizes the whole conversation
iscekic f39d70c
fix(extension): address PR review on compaction transcript and CI paths
iscekic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,120 @@ | ||
| name: extension CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - 'apps/extension/**' | ||
| - 'pnpm-lock.yaml' | ||
| - 'pnpm-workspace.yaml' | ||
| - '.nvmrc' | ||
| - '.github/workflows/extension-ci.yml' | ||
| pull_request: | ||
| branches: [main] | ||
| paths: | ||
| - 'apps/extension/**' | ||
| - 'pnpm-lock.yaml' | ||
| - 'pnpm-workspace.yaml' | ||
| - '.nvmrc' | ||
| - '.github/workflows/extension-ci.yml' | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: read | ||
|
|
||
| jobs: | ||
| # Compiler, linter, formatting and unit tests, via the extension's own `verify` | ||
| # script so the extension's stricter (type-aware) oxlint config is what runs. | ||
| verify: | ||
| runs-on: ${{ vars.RUNNER_DEFAULT_LABEL || 'ubuntu-latest' }} | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: useblacksmith/checkout@41cdeedae8edb2e684ba22896a5fd2a3cb85db6b # v1 | ||
| with: | ||
| lfs: true | ||
|
|
||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
| cache: 'pnpm' | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Verify (typecheck, lint, format, unit tests) | ||
| run: pnpm --filter kilo-extension verify | ||
|
|
||
| # Prove the Firefox MV3 target still builds (the Chrome build runs inside e2e). | ||
| build-firefox: | ||
| runs-on: ${{ vars.RUNNER_DEFAULT_LABEL || 'ubuntu-latest' }} | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: useblacksmith/checkout@41cdeedae8edb2e684ba22896a5fd2a3cb85db6b # v1 | ||
| with: | ||
| lfs: true | ||
|
|
||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
| cache: 'pnpm' | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Build (Firefox MV3) | ||
| run: pnpm --filter kilo-extension build:firefox | ||
|
|
||
| # Chrome end-to-end tests. `e2e:chrome` builds the Chrome MV3 bundle first, so this | ||
| # also covers the Chrome build. Firefox Selenium e2e (`e2e:firefox`) is intentionally | ||
| # not run here: it relies on geckodriver tab detection that is unreliable headless. | ||
| e2e-chrome: | ||
| needs: verify | ||
| runs-on: ${{ vars.RUNNER_LARGE_LABEL || 'ubuntu-24.04-8core' }} | ||
| timeout-minutes: 20 | ||
| env: | ||
| CI: 'true' | ||
| steps: | ||
| - uses: useblacksmith/checkout@41cdeedae8edb2e684ba22896a5fd2a3cb85db6b # v1 | ||
| with: | ||
| lfs: true | ||
|
|
||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
| cache: 'pnpm' | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Install Playwright Chromium | ||
| run: pnpm --filter kilo-extension exec playwright install --with-deps chromium | ||
|
|
||
| - name: Run Chrome e2e (builds the Chrome MV3 bundle first) | ||
| run: pnpm --filter kilo-extension e2e:chrome | ||
|
|
||
| - name: Upload Playwright report on failure | ||
| if: failure() | ||
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | ||
| with: | ||
| name: extension-playwright-report | ||
| path: | | ||
| apps/extension/playwright-report | ||
| apps/extension/test-results | ||
| retention-days: 7 | ||
| if-no-files-found: ignore | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.