← Back to Pull requests

chore(agents-state): amend api#852 support token proposal #2240

Closed
unknown closed this pull request without merging on Oct 28, 2026 20:06 UTC
View on GitHub
unknown unknown commented on Oct 28, 2026 20:02 UTC
Author

Owner-requested amendments to the mctl-api#852 proposal (S2f, mctlhq/.github#270), before approval.

1. Token lifetime. The minted token for mctl_ask_support was bound to the MCP wait (SUPPORT_ASK_WAIT + 60s, 120s by default).
- mctl-support keeps the caller's bearer for the whole task. finish_task_execution (src/mctl_support/executors/lifecycle.py) closes the WorkItemExecution with it when the task ends.
- A task may run up to SUPPORT_TASK_DEADLINE_SECONDS (ceiling 600s) and keeps running after the tool returns non-terminal.
- Every longer task would therefore leave an unfinished execution: the failure is only logged and terminal_at is never set.
- Change: new SUPPORT_TOKEN_TTL, default 11m, bounded 2m..15m. MaxSupportTokenTTL goes from 5m to 15m. mctl_get_support_task keeps its short TTL. The token stays narrow: support audience, four routes, no refresh.
2. whoami parity. The minted token has no groups claim, and mctl-support's tenant check reads whoami. New requirement and test T12: whoami with a minted token returns the same id, isAdmin, namespaces and groups as the caller's API token. T13 checks that the token is still valid when the execution is finished after the tool returned.

Task 6a adds the config. The T4 expectation is updated. The rollback note now says 15 minutes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SgyPxytxB3LFg5X1LgrycU

Diff: 183 lines (+137 / -46) across 2 files Reviewer: claude[bot] Review duration: 3m
All Vouch review confidence checks passed
Residual risk 0.25 = Change Risk (0.59) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.59 · 183 lines diff across 2 files
0.59
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 85% · Reviewer familiarity: 35%
56%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.312
Shallow Review Depth shallow_review_depth
0.289
Sensitive Paths sensitive_paths
0.059
Real PR Conversation Timeline
1 comments
"Review active on #2240"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 56.9% reviewed sensitive_module
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 58.8% (MEDIUM) · Higher = larger blast radius
58.8%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 56.9% · Lower = rushed or shallow review
56.9%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 25.4% · Safe to merge
25.4%