fix(access-policy): show eval-result explicitly and auto-refresh expired debug token - #121
Merged
aleksandrkislitsyn merged 1 commit intoJul 24, 2026
Conversation
…red debug token Policy Dev Tool improvements: - Show `eval-result` explicitly as the first field of each policy's YAML in the Policy eval panel, instead of encoding pass/fail only via the red/green policy-name color. Makes the debug output readable at a glance. - Auto-refresh the eval-policy debug token on expiry. executeDebugRequest returns the 403 as a normal response (it does not throw), so the previous catch-based retry never fired and the tool got stuck showing "eval-policy-debug-token is expired". Detect that response, refresh the token, and retry once. - Add an "external link" affordance to open a policy in the AccessPolicy editor from the eval list.
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.
Summary
Three fixes to the AccessPolicy Policy Dev Tool:
Show
eval-resultexplicitly. Previously each policy's pass/fail was communicated only through the red/green color of its name — the boolean itself was filtered out of the displayed YAML. Noweval-resultis shown as the first field of each policy block, so you can read the result directly alongsiderole,errors, etc.Auto-refresh the expired debug token. The tool signs each Debug request with a short-lived
eval-policy-debug-token.executeDebugRequestcatches transport errors internally and returns the403as a normalResponseData(it does not throw), so the existingcatch-based "retry once" never fired for the expired-token case. The tool got stuck showing403 {"message":"eval-policy-debug-token is expired"}until a full page reload. Now we detect that specific 403, refresh the token, and retry once.Open-in-editor affordance. Added an external-link icon on each non-current policy row in the eval list that deep-links to the AccessPolicy editor.
Testing
pnpm biome check— passes for the changed file.pnpm typecheck— no new errors introduced by this change. (Two pre-existing errors onmasterremain:notebook-chart/fold-data.tscodemirror duplicate-types — unrelated to this PR.)eval-resultnow renders per policy, and an expired token silently refreshes on the next Debug instead of showing the stuck 403.🤖 Generated with Claude Code