Repository navigation
feat: add host-visible integration diagnostics - #1360
Merged
Merged
Conversation
4 of 29 tasks
This was referenced Sep 4, 2026
tlyyxjz
added a commit
to tlyyxjz/ob2026-powercontext
that referenced
this pull request
Oct 9, 2026
…g treats as domain Both from @AlexStocks' review of oceanbase#1883. The 400 branch added by this PR could not name the real condition, because the code the Server sends there was still unpublished: `invalid_cursor` was absent from `PUBLIC_ERROR_CODES`, so the branch collapsed it to `invalid_request`. That is the same defect the previous commit fixed for 410, 428 and 429, and `invalid_cursor` is the 400 half of the cursor pair — RFC 1502 says "return `400 invalid_cursor`; expired cursors return `410 cursor_expired`". Both are published now, and the 400 result carries the cursor recovery rather than "fix the request shape", because the two conditions call for different actions. Only this code was reachable: `distinct_scopes_required` can also follow a 400, but its sole raise site passes `field="scope_id"`, which routes to 422. `isDomainStatus` still listed 404, 409 and 422, the three statuses the mapping had a branch for when oceanbase#1360 introduced it. The mapping now gives 400, 410, 412, 413, 428 and 429 their own branches as domain outcomes too, so the diagnostic layer withheld a diagnostic for a 409 while logging one for a 412 — the same class of rejection, two behaviours. The set is now `DOMAIN_STATUSES`, and `tests/error-mapping.spec.ts` asserts it against the statuses `mapServerError` branches on plus 401/403, so the two layers cannot drift apart again. `pnpm test` 309 passed / 1 skipped (305 before), `lib/` rebuilt, and the result-code table in both integration guides lists `invalid_cursor`.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Which issue or RFC does this PR close?
This PR implements the first step of #1298. It does not close #1298.
This PR is downstream of #1343 and should be reviewed after #1343 is merged.
Rationale for this change
When PowerContext is unavailable or returns an incompatible response, integrations currently provide limited or inconsistent feedback. Users need a bounded, fail-open diagnostic that explains the failure and points to
powercontext doctorwithout exposing request details or disrupting the host.What changes are included in this PR?
authentication_failedversion_mismatchserver_unavailableinvalid_responsestderrpowercontext.codex.recallstderrpowercontext.claude_code.recallpowercontext.dshpowercontext.openclawpowercontext.pipowercontext.hermespowercontext doctorrecovery hint for unavailable servers.Are there any user-facing changes?
Yes.
Users now receive a bounded diagnostic when PowerContext is unavailable or returns a classified failure. Normal host execution continues, and no URL, token, response body, or user content is included in the diagnostic.
There are no breaking API or persistence-format changes.
How was this change tested?
uv run pytest tests/integrations/test_hermes_provider.py -q— 36 passeduv run ruff check integrations/hermes/plugins/powercontext/commands.py tests/integrations/test_hermes_provider.py— passednode --checkpowercontext doctorrecovery metadata.AI usage statement
Implemented and reviewed with OpenAI Codex