Skip to content

fix(client): preserve structured read failures and retry hints - #57

Open
ooodummy wants to merge 2 commits into
mainfrom
fix/session-retrieval-reliability-20261115
Open

ooodummy wants to merge 2 commits into
mainfrom
fix/session-retrieval-reliability-20261115

Conversation

@ooodummy

Copy link
Copy Markdown
Collaborator

Summary

Preserve native HTTP failures when the response does not have an endpoint's success shape. This fixes three client-side losses:

  • Bare JSON errors previously went through the gateway fallback and lost their native code/full details.
  • Paginated failures without data or pagination fields failed deserialization before their error envelope was classified.
  • The structured-response fallback, including forbidden responses, discarded Retry-After.

Both decoders now use the existing structured-body failure path when their success envelope cannot deserialize. Status, native code/body and retry delay remain available to MCP error guidance. Successful standard/legacy pages are unchanged; no request retry policy changes.

Evidence and scope

A session-history audit found GraphLoading HTTP409 failures followed by the single retry instructed by the tool; some retries timed out. Those historical outputs do not establish the original raw wire-envelope shape or prove an agent retry loop. Source inspection exposed the decoding defects above; deterministic loopback regressions cover them. This PR does not fix or claim to explain the server's graph-loading availability.

Seven new regressions cover bare loading errors through actual MCP error rendering, paginated errors without success fields, errors with incompatible success-data types, non-loading conflicts, plain-text gateways, successful standard/legacy pages, and forbidden responses with exactly one request.

Verification

Windows x64, Rust1.98.1, nextest0.9.152; eight build/test workers, isolated target directory:

  • cargo fmt --check — passed.
  • cargo nextest run --workspace --locked --test-threads 8 --no-fail-fast — 585 passed, 2 skipped by the existing suite.
  • cargo clippy --workspace --all-targets --locked -- -D warnings — passed.
  • RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --document-private-items --locked — passed.

Local environment corrections: moved only this task's generated target off a full drive; placed the installed Rust toolchain ahead of an unconfigured mise rustfmt shim for subprocess tests. No tests were weakened or production formatter behavior changed. Linux/macOS execution remains to CI.

Built on an isolated branch from origin/main (14c584e) to preserve unrelated existing checkout edits. OMP local settings and private Discord/history evidence are not included in this PR.

- Decode native JSON and paginated failures without requiring success data or page fields.
- Preserve native error codes, full diagnostics and Retry-After through fallback and forbidden response paths.
- Add seven offline regressions covering MCP guidance, unchanged success shapes and no extra retries.
- Replace map/unwrap_or_default chains with equivalent lazy map_or_else defaults and borrowed-string map_or values.
- Preserve existing behavior and older API compatibility without suppressing warnings or pinning CI to an older compiler.
- Verify formatting, Clippy, 585 tests and rustdoc with CI-matching Rust 1.100.0.
@ooodummy

Copy link
Copy Markdown
Collaborator Author

Fixed CI in 155939b. Rust 1.100.0 Clippy rejected 17 map/unwrap_or_default chains under -D warnings. Replaced them with equivalent map_or/map_or_else expressions; no lint suppression or toolchain downgrade.

Verification: all six GitHub checks passed (Ubuntu, macOS, Windows; push and pull_request workflows). Local Rust 1.100.0 formatting, Clippy, rustdoc, and tests passed: 585 passed, 2 skipped.

CI: https://github.com/napbat/semctl/actions/runs/43752578692

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant