Review fixes#2
Conversation
Greptile SummaryThis PR addresses a batch of correctness and security fixes across the OAuth/command-security, JS runtime, and edit-tool layers. All changes are targeted, well-tested, and come with accurate documentation updates.
Confidence Score: 5/5Safe to merge — all changes are targeted fixes with no regressions introduced. Every changed code path is directly covered by new or updated tests. The security-model changes (command-group conjunction, fail-closed scope grants, timing-safe comparisons) are correctly implemented and represent improvements over the previous code. The JS timeout fix is bounded in its worst case and validated by a new test. No logic holes were found on review. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Incoming Bearer Token] --> B{scopeGrants mode?}
B -- No --> C[grant = null]
B -- Yes --> D[scopesToGrant scopes]
D --> E{Any tools:* scopes?}
E -- Yes --> F["grant = { tools: [...] }"]
E -- No --> G["grant = { tools: [] }\n(fail closed)"]
C --> H[buildSessionSecurity global, null]
F --> H
G --> H
H --> I{grant null?}
I -- Yes --> J[Return global config\nminus onToolsChanged hook]
I -- No --> K[Intersect tools\nglobal ∩ grant]
K --> L[Filter paths\ngrant ⊆ global paths]
L --> M[AND command groups\nglobal groups + grant group]
M --> N[Per-session SecurityConfig]
N --> O{validateCommand?}
O --> P["For each group: command must\nmatch ≥1 pattern (AND of ORs)"]
P -- Fails any group --> Q[Throw: Command not allowed]
P -- Passes all groups --> R[Allow]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[Incoming Bearer Token] --> B{scopeGrants mode?}
B -- No --> C[grant = null]
B -- Yes --> D[scopesToGrant scopes]
D --> E{Any tools:* scopes?}
E -- Yes --> F["grant = { tools: [...] }"]
E -- No --> G["grant = { tools: [] }\n(fail closed)"]
C --> H[buildSessionSecurity global, null]
F --> H
G --> H
H --> I{grant null?}
I -- Yes --> J[Return global config\nminus onToolsChanged hook]
I -- No --> K[Intersect tools\nglobal ∩ grant]
K --> L[Filter paths\ngrant ⊆ global paths]
L --> M[AND command groups\nglobal groups + grant group]
M --> N[Per-session SecurityConfig]
N --> O{validateCommand?}
O --> P["For each group: command must\nmatch ≥1 pattern (AND of ORs)"]
P -- Fails any group --> Q[Throw: Command not allowed]
P -- Passes all groups --> R[Allow]
Reviews (2): Last reviewed commit: "Review fixes" | Re-trigger Greptile |
No description provided.