Skip to content

fix: classify Copilot connection-bound replay rejections - #78

Closed
paulorha wants to merge 1 commit into
NousResearch:mainfrom
paulorha:fix/copilot-replay-classification
Closed

paulorha wants to merge 1 commit into
NousResearch:mainfrom
paulorha:fix/copilot-replay-classification

Conversation

@paulorha

@paulorha paulorha commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Classify only Copilot's HTTP 401 message input item does not belong to this connection as invalid encrypted content, rather than an authentication failure. Mark it non-rotating and non-fallback so core can repair the rejected request without treating the account as exhausted.

Related issue: #42

Provider-specific classification stays in copilot/responses.py, following the ownership guidance.

Changes

  • Inspect the actual error message and HTTP status through the existing profile classification hook.
  • Exclude this narrow rejection from stale-credential renewal.
  • Retain genuine token expiry, ordinary authentication failure and stale-integrator handling.
  • Cover unrelated messages/statuses, malformed bodies, non-message fields and provider/host scoping.

No proactive replay stripping, credential resolver change or new pool SDK dependency is introduced. The rebase preserves upstream's current reasoning payload and live-catalog behavior.

Required core companion and release ordering

Ship NousResearch/hermes-agent#154361 (fix: repair classified encrypted replay before auth recovery) before distributing this plugin classification update. Both changes are required for complete rejection repair: this PR classifies the provider-specific rejection; the companion performs bounded, request-attributed repair before authentication recovery. Passing plugin checks against core main does not establish that the companion recovery is available there.

The independent pool track is NousResearch/hermes-agent#154360 and #77; neither is a dependency of this classification change. If the two core PRs land separately, preserve classified-replay-before-auth handling and scoped-pool-or-legacy-profile selection when reconciling their shared recovery files. Earlier combined-track validation is historical, not a fresh integrated run on these rebased heads.

Any later catalog distribution must pin an actual merged Labs revision. This PR changes no catalog pin, installed plugin or saved account.

How to test

Set CORE to an absolute compatible core checkout and HERMES_PYTHON to its managed test interpreter. From github-copilot/, using an isolated home and cleared ambient credentials:

HERMES_AGENT_REPO="$CORE" PYTHONPATH="$CORE" "$HERMES_PYTHON" -m pytest -q
PYTHONPATH="$CORE" "$HERMES_PYTHON" -m hermes_cli.main plugins validate .

Core must be on PYTHONPATH; the standalone plugin does not supply the providers package.

Current validation

Labs head e8b071277e9f7b67e0aa32e05a753b8088993cf9 is rebased onto upstream Labs main 46f6da9af0c4e9ad5a3c9444dfecfa5bf7debf76. The fix was not already upstream. Rebase was conflict-free and git range-diff confirms the original patch is unchanged; git diff --check passes.

Fresh macOS validation, with isolated homes and ambient credentials cleared:

  • Full plugin suite against the local rebased companion core snapshot 38279951d45d17ca1c724c99eb453af16ba2d044 (base d1b46d718ffe675427928eff7e5fff69bcb4519b): 182 passed, no skips; plugin validation passed.
  • Full plugin suite against upstream core snapshot d1b46d718ffe675427928eff7e5fff69bcb4519b: 182 passed, no skips; plugin validation passed. This is classification compatibility, not proof of companion recovery on upstream core.

These are separate runs of the same suite, not an additive test total. The local companion snapshot identifies exactly what was exercised; it does not assert the companion PR's eventual rebased publication SHA. Existing copilot-acp live-client isolation remains in-process only.

The original intermittent live rejection was not reproduced. Local tests use synthetic offline errors; no live-provider reproduction or whole-core-suite pass is claimed.

Hosted CI and review status

The exact-head workflow passed all 19 jobs, including the Copilot suite and validation on Linux, macOS and Windows. The workflow checks upstream core main, not the companion recovery branch, so the core-before-plugin release gate still applies.

No GitHub reviews, inline review comments or issue comments were present when updating this PR. No comments or review replies were posted.

@teknium1

Copy link
Copy Markdown
Contributor

Thank you @paulorha! This landed on main through #99, which stacked the 23 reviewed labs PRs on current main so their shared files conflicted only once. Your commits are kept with your authorship; this PR's tip is 03f4f3b. To get it now: hermes plugins install NousResearch/hermes-labs-plugins#<plugin> --force; hermes plugins update follows once the catalog pin moves (in progress).

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.

2 participants