Repository navigation
fix(native-chat): read ZCode conversations in their recorded order #27142
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
0e5d8fd
feat(native-chat): read ZCode session transcripts through the OpenCod…
star-nebula 26010e2
fix(native-chat): preserve ZCode store selection and transcript order
nwparker aa7ee0b
test(native-chat): run ZCode SQLite fixtures on the production runtime
nwparker d7b896a
test(native-chat): seed ZCode through the execution host
nwparker 4c67d43
fix(native-chat): prepare SQLite readers for ZCode-only WSL homes
nwparker fadf3c3
Merge remote-tracking branch 'origin/main' into nwparker/zcode
nwparker b0ab90a
test(native-chat): verify ZCode readers on every desktop platform
nwparker 4c4b6e5
test(native-chat): seed large transcript fixtures in one transaction
nwparker 3bc0200
test(composer): reuse fixtures to restore the main lint gate
nwparker 09da57f
Merge branch 'nwparker/zcode-ci-baseline' into nwparker/zcode
nwparker 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,40 @@ | ||
| name: ZCode transcript contract | ||
| on: | ||
| pull_request: | ||
| paths: | ||
| - 'src/main/ai-vault/session-scanner-zcode*' | ||
| - 'src/main/ai-vault/session-scanner-opencode*' | ||
| - 'src/main/ai-vault/opencode-wsl-runtime*' | ||
| - 'src/main/native-chat/transcript-opencode*' | ||
| - 'src/main/native-chat/transcript-zcode*' | ||
| - 'src/shared/native-chat-types.ts' | ||
| - 'src/shared/native-chat-transcript-projection*' | ||
| - '.github/workflows/zcode-transcript-contract.yml' | ||
| workflow_dispatch: | ||
| permissions: | ||
| contents: read | ||
| concurrency: | ||
| group: zcode-transcript-contract-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
| jobs: | ||
| transcript-readers: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-22.04, macos-15, windows-2022] | ||
| runs-on: ${{ matrix.os }} | ||
| timeout-minutes: 20 | ||
| env: | ||
| ORCA_BACKGROUND_LAUNCH: '1' | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: ./.github/actions/install-node-dependencies | ||
| with: | ||
| native-runtime: node | ||
| - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | ||
| with: | ||
| bun-version-file: config/.bun-version | ||
| - name: Verify SQLite ordering, legacy readers, and host routing | ||
| run: pnpm test src/main/native-chat/transcript-zcode.test.ts src/main/native-chat/transcript-opencode.test.ts src/main/native-chat/transcript-opencode-sqlite-query.test.ts src/main/native-chat/transcript-opencode2-sqlite.test.ts src/main/native-chat/transcript-opencode-semantic-fidelity.test.ts src/main/native-chat/transcript-opencode-read-bounds.test.ts src/main/native-chat/transcript-opencode-subscribe.test.ts src/main/ai-vault/session-scanner-zcode.test.ts src/main/ai-vault/session-scanner-zcode-sources.test.ts src/main/ai-vault/opencode-wsl-runtime-preparation.test.ts src/main/ai-vault/session-scanner-opencode-wsl-routing.test.ts src/shared/native-chat-transcript-projection.test.ts src/renderer/src/components/native-chat/structured-agent-session-transcript-order.test.ts | ||
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
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
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
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
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
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
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
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
17 changes: 17 additions & 0 deletions
17
src/main/native-chat/transcript-opencode-fingerprint-window.ts
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,17 @@ | ||
| export function pruneOpenCodeFingerprintCache( | ||
| fingerprints: Map<number, string>, | ||
| cap: number, | ||
| agent?: 'zcode' | ||
| ): void { | ||
| if (fingerprints.size <= cap) { | ||
| return | ||
| } | ||
| const keys = [...fingerprints.keys()] | ||
| const newest = agent === 'zcode' ? keys.toReversed() : keys.sort((a, b) => b - a) | ||
| const keep = new Set(newest.slice(0, cap)) | ||
| for (const rowid of fingerprints.keys()) { | ||
| if (!keep.has(rowid)) { | ||
| fingerprints.delete(rowid) | ||
| } | ||
| } | ||
| } |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Include transcript routing files in the workflow path filter.
If a PR changes only
src/main/native-chat/transcript-reader.tsorsrc/shared/native-chat-agent-support.ts, this workflow does not run. Both files are part of the ZCode transcript routing covered by this contract. Add the routing and agent-support paths to the filter so those changes receive the cross-platform check.