Repository navigation
feat(sessions): read Copilot CLI transcripts - #1785
Conversation
Add a read-only Copilot session adapter for 0.0.x and 1.0.x event logs, including workspace, model, tool-call, and tool-result recovery. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
No confident findings in the scoped PR diff. The description satisfies the real-CLI testing requirement: it records a successful build and Review was read-only; I did not run, build, or install PR code. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Fixed the CI regressions in The Copilot adapter changes Copilot from an unread tool to a readable session source, so I updated the three stale expectations that still assumed otherwise:
Validation: the session-sharing unit suite passes (13 tests), the targeted E2E reaches the updated assertion locally, typecheck passes, targeted type-aware oxlint passes, and |
|
No confident findings in the scoped PR diff. The earlier review raised no findings, so there are none to mark resolved. The PR description satisfies the real-CLI testing requirement: it records a successful build and Review was read-only; I did not run, build, or install PR code. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
I built 522b44bb and the merge-base (05fe72a2) and ran session push --source copilot on both:
- Base: exits 1 with
Unknown platform "copilot". - Head: archives 4 sanitized fixtures, plus 30 real local Copilot CLI logs from versions 0.0.411 and 1.0.90. For every session the archived message count matches the raw log. A partial last line is handled. I had no 1.0.107 logs to check against.
[P2 non-blocking] One malformed line anywhere except the last fails the whole Copilot listing. parsed() in src/session-flow/adapters/copilot.ts:154-166 parses every events.jsonl with no handling per file. I put one bad non-final line in one session, and then:
session push --source copilot --allexits 1 and archives nothing;session migrateof a different, valid session fails withlist_failed.
The Claude adapter skips a bad session and keeps going. None of the 30 real logs had a bad line, so this needs a corrupted file, but when it happens it takes out every Copilot session. Fix: wrap parseCopilotFile in parsed(), so a file that fails to parse is skipped and logged at debug.
[P2 non-blocking] The score --session --source copilot item from #1418 has no record. Neither the body nor my runs cover it. It needs an initialized repo and a judge.
[P2 non-blocking] docs/guide/dashboard.md:367 and the zh-CN page still don't list copilot among the session platforms.
[P3 nit]
- The adapter's own write-error text never appears through
migrate, because the read-only message comes from the platform facts (agent-session.ts:162-167). - Records that fail the schema are skipped without a message. I saw no loss from it.
- The body's caveats about Windows and the doc checker are out of date: both pass in CI at this head.
- The real-CLI record cites 1.0.107 but only summarizes the run. Pasting the commands and output would make it checkable.
CI review: it reports no findings. I disagree on the malformed-line case above, which it did not raise. CI is green at this head, apart from the GitHub-provider E2E, which is skipped on forks.
Merge risk: medium
- Alignment: decent. The reader and its registry, platform facts, the
TOOLSentry and README marks are consistent. The score item and the dashboard doc are missing. - Impact: medium. It adds a new session source to push, migrate, score and the dashboard. Other platforms are untouched.
- Verification: decent. Built-CLI runs on real logs from two Copilot versions, and green CI. Not run: score, and the 1.0.107 format.
- Rollback cost: low. It only adds code.
- Error detection: decent. One bad file fails the whole platform instead of only that session.
@jeff-r2026 your call on this one: it adds Copilot CLI as a new session source. The code works on real logs. The malformed-file case above is the one change I'd want before it ships.
One malformed line in any events.jsonl made the whole Copilot listing throw, so `session push --all` archived nothing and migrating another valid session failed. A log that fails to read is now skipped with a debug line, and the other sessions still list.
Copilot CLI sessions are read-only sources, so they belong in the platform list next to omp and agy.
|
No confident findings in the scoped PR diff. Earlier reviews raised no findings, so there are none to mark resolved. The PR description satisfies the real-CLI testing requirement: it records a successful build and Review was read-only; I did not run, build, or install PR code. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Approving. I pushed two commits on top so this can land:
b3b404c4freads each Copilot log through a wrapper, so a log that fails to parse is skipped with a debug line and the other sessions still list. The new test, two sessions with a malformed middle line in one, failed before and passes now.407fc95ddaddscopilotto the session platforms indocs/guide/dashboard.mdand the zh-CN page.
On the built CLI with one good log and one with a malformed middle line, session push --source copilot --all --repo-root <repo> -y used to exit 1 with Listing copilot sessions failed: Unexpected end of JSON input and archive nothing. Now it exits 0, archives the good session and writes the skip to the debug log. The earlier runs on 30 real logs from Copilot 0.0.411 and 1.0.90 still apply.
Still open, and not blocking: the score --session --source copilot record from #1418, which needs a judge. The shared readJsonl throws on a malformed non-final line, so other adapters that call it without a per-file catch can fail the same way. That is a separate follow-up.
Merge risk: low
- Alignment: good. The Copilot CLI reader, the
TOOLSentry, the README marks and the docs are consistent. - Impact: medium. It adds a new read-only session source. Other platforms are untouched.
- Verification: good. Built-CLI runs on real logs from two versions, the malformed-log case before and after, and CI.
- Rollback cost: low. The change only adds code.
- Error detection: good. A damaged log is skipped and logged instead of hiding every session.
Summary
Adds a read-only GitHub Copilot CLI session adapter for the Copilot portion of #1418.
session-state/<id>/events.jsonllogsworkspace.yamlwhen it is absent from the event streamType of Change
Test Plan
npx tsc --noEmitpassesnpm run lintpassesnpx vitest runpassesnpx vitest run src/__tests__/copilot-session-adapter.test.ts src/__tests__/session-platform-facts.test.ts src/__tests__/locate-sessions.test.ts— 553 tests passednpm run buildpassessession push --source copilotarchived 3 native sessions into an isolated Git repositoryscore --sessionwas not run because this checkout is not initialized as a TeamAI repository (not_initialized)The full Windows suite and repository-wide documentation checker are not clean in this checkout for pre-existing, unrelated workflow/docs and Windows fixture failures; the focused adapter, registry, platform-facts, build, typecheck, and lint coverage above is green.
Related Issues
Part of #1418
Notes for Reviewers
ToolUnavailableError.workspace.yamlis a fallback for logs that do not carry a workspace event.--cwdfiltering consistent.