rust: `Client::resume_session` errors do not say which stage failed, or whether the session's history could not be loaded
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 52/100
Rechercherichtung
Start at Client::resume_session and trace the session.resume reply, result decoding, and finish_session_setup calls, including the existing ErrorKind::Session(NotFound) mapping. Compare how each failure is currently surfaced and define verification around distinguishing resume or history-loading errors from post-resume setup failures without matching free-form text.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
Client::resume_session returns one Error for every failure along the resume path:
- the
session.resumeJSON-RPC reply itself; - decoding its result (
SessionIdMismatch, JSON); - the follow-up setup calls the SDK makes after a successful reply (the MCP auth-interest registration, then
finish_session_setup's options update, which disconnects the session when it fails).
Only a reply whose message contains "Session not found" is typed (ErrorKind::Session(NotFound)). Every other failure becomes Error::from_rpc with the CLI's message text.
So a host cannot tell apart:
- the CLI refused to load the session's stored history (the transcript exists but could not be restored), where the right response is to stop and tell the user rather than silently start a new, empty session;
- a non-history fault on the same reply (authentication, invalid parameters, a concurrent-handle race), which is often transient;
- a failure in the SDK's own post-resume setup, after the CLI had already loaded the session.
The only way to separate them today is to match on free-form message text, which is fragile across CLI versions.
Affected versions
github-copilot-sdk (Rust) 1.0.14 and 1.0.15, with Copilot CLI 1.0.85 through 1.0.89.
Observed
Captured with Copilot CLI 1.0.89 and github-copilot-sdk 1.0.15 (paths, ids and the quoted transcript line replaced by placeholders):
- The stored history cannot be loaded (the session's
events.jsonlhas an unparseable first record):code=-32603 Request session.resume failed with message: session resume failed: Failed to read JSONL from <path>/events.jsonl: Invalid event at line 1: expected ident at line 1 column 2. Event: <line text> - The session has no stored events (an empty
events.jsonl):code=-32603 Request session.resume failed with message: Failed to load session events: Session not found: <session-id>
Both come back as the same generic JSON-RPC code, -32603. The SDK types only the second one, ErrorKind::Session(NotFound), because its message contains "Session not found". The first one reaches the host as Error::from_rpc with free-form text. So do non-history faults on the same reply and failures in the SDK's own post-resume calls.
The first message also quotes the offending transcript line verbatim after Event: . A host that logs the error text therefore logs conversation content, unless it strips that text itself. A structured error would avoid the need to parse or scrub it.
Expected
One of the following, in order of preference:
- (a) The SDK types the stage: for example
ErrorKind::Session(ResumeRejected { code, message })for an error on thesession.resumereply, distinct fromErrorKind::Session(SetupFailed { .. })for the SDK's own post-resume calls. - (b) The CLI gives "stored history could not be loaded" its own JSON-RPC error code, or a structured
datafield such as{"reason": "history_unloadable"}, and the SDK surfaces it as a typed kind, the way it already does for "Session not found".
Why it matters
A host that must never continue a conversation without its prior context has to refuse the turn when history cannot be restored. Without a typed signal, it must either refuse on every resume error, so transient faults read as lost history, or fall back to a fresh session, which silently drops the conversation's context.
Proposed fix
- The SDK side of (a) is local to
Client::resume_session: wrap thesession.resumecall's error separately from the result decode and fromfinish_session_setup. - (b) needs a CLI-side error code, which the SDK then maps the way it maps "Session not found" today.
- Vorherrschende Sprache
- Java
- Sterne
- 10.7k
- Forks
- 1.5k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus github/copilot-sdk
-
Rust: ElicitationRequest drops the tool call id from elicitation.requestedEvtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
github/copilot-sdk#2900 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 84/100
github/copilot-sdk#2876 · 1 Kommentar · 1 Reaktion ·
-
Python ModelLimits drops max_output_tokens from model metadataEvtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
github/copilot-sdk#2798 · 1 Kommentar ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
github/copilot-sdk#2759 ·
-
docs/AGENTS.md is repo authoring guidance, but everything in docs/ gets publishedEvtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offendocumentation
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
github/copilot-sdk#2758 ·
Alle Issues in github/copilot-sdk
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
ls1intum/thesis-management#1473 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
LunaDeerMC/Dominion#301 · 1 Kommentar ·
-
[FEATURE] Expose external refresh, node-level translog and warmer statsEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenuntriaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
opensearch-project/opensearch-prometheus-exporter#680 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
Maintainer antworten meist innerhalb von 2 Tagen