-
Notifications
You must be signed in to change notification settings - Fork 552
fix(draft-launcher): include bypass permissions timeout in launch request #762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
K-Mistele
merged 1 commit into
main
from
kyle/eng-2299-fix-bypass-permissions-timeout-not-being-set-when-enabled-in
Oct 16, 2025
Merged
fix(draft-launcher): include bypass permissions timeout in launch request #762
K-Mistele
merged 1 commit into
main
from
kyle/eng-2299-fix-bypass-permissions-timeout-not-being-set-when-enabled-in
Oct 16, 2025
Conversation
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
…uest When users enabled bypass permissions with a timeout in the draft launcher, the timeout value was being discarded. This resulted in bypass permissions staying enabled indefinitely instead of expiring after the selected duration. Changes: - Add savedBypassTimeout state to track user's timeout selection - Update confirmation handler to save timeout value from dialog - Clear timeout state when bypass permissions is toggled off - Include dangerouslySkipPermissionsTimeoutMs in session update payload - Convert timeout from minutes to milliseconds before sending to backend The backend already had correct logic to recalculate expiration from the stored timeout duration. This fix ensures the timeout value actually reaches the backend when launching draft sessions. Fixes ENG-2299
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important
Looks good to me! 👍
Reviewed everything up to 799c5e2 in 2 minutes and 3 seconds. Click for details.
- Reviewed
58lines of code in1files - Skipped
0files when reviewing. - Skipped posting
4draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. humanlayer-wui/src/components/internal/SessionDetail/components/DraftLauncherForm.tsx:58
- Draft comment:
Initializing 'savedBypassTimeout' with a default value of 15 (minutes) – please confirm this default is intended and document the unit. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =50%<= threshold50%The comment is asking for confirmation of the default value and documentation of the unit. While asking for confirmation is not allowed, suggesting documentation of the unit is a valid request. The comment is partially useful.
2. humanlayer-wui/src/components/internal/SessionDetail/components/DraftLauncherForm.tsx:470
- Draft comment:
Converting 'savedBypassTimeout' from minutes to milliseconds using a truthy check. If 0 is a valid timeout, this will treat 0 as false. Consider an explicit null check. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% While technically correct that 0 would be treated as falsy, examining the codebase shows that: 1. savedBypassTimeout is explicitly typed as number | null, 2. It's initialized to 15, 3. It can only be set to null or a positive number through the UI dialog, 4. A timeout of 0 minutes wouldn't make sense in this context. So while the comment is technically accurate, it's pointing out a theoretical issue that can't actually occur in practice. I could be wrong about the UI constraints - perhaps there is a way to set a 0 timeout that I'm not seeing in the code. Also, even if it's not currently possible, future changes might make it possible. The comment suggests a fix for a problem that can't occur in practice. The type system and UI ensure that savedBypassTimeout is either null or a positive number. Making the code more verbose to handle an impossible case would reduce readability without adding value. Delete this comment. While technically correct, it points out a theoretical edge case that can't occur in practice due to the type system and UI constraints. The current code is more readable and the suggested change would add complexity without benefit.
3. humanlayer-wui/src/components/internal/SessionDetail/components/DraftLauncherForm.tsx:465
- Draft comment:
Avoid using 'any' for the update payload. Consider defining a proper type/interface for the payload instead of casting to 'any'. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. humanlayer-wui/src/components/internal/SessionDetail/components/DraftLauncherForm.tsx:571
- Draft comment:
The updated 'handleDangerousSkipPermissionsConfirm' now accepts a 'timeoutMinutes' parameter. Although state setters are stable, consider documenting the expected behavior and units for clarity. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% While documentation could be helpful, this seems like a straightforward internal callback function where the parameter name timeoutMinutes is self-documenting. The usage is clear from the code - it's used to set a timeout in minutes that gets converted to milliseconds later. The null case is also handled appropriately. This feels like an overly pedantic suggestion that doesn't meaningfully improve code quality. I could be wrong if there are important edge cases or behaviors that aren't obvious from the code. Maybe there are constraints on valid timeout values that should be documented. The parameter name clearly indicates the units (minutes), the type indicates it can be null, and the usage shows exactly how it's used. Additional documentation would be redundant. This comment should be deleted as it suggests documentation that would be redundant with the self-documenting parameter name and clear usage in the code.
Workflow ID: wflow_FP3ovU7IVFW2DEbm
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
dexhorthy
approved these changes
Oct 16, 2025
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.
What problem(s) was I solving?
When users enabled bypass permissions with a timeout (e.g., "bypass for 15 minutes") in the draft launcher UI, the selected timeout value was being discarded. This resulted in:
The root cause: The frontend was storing the "bypass permissions enabled" flag in localStorage, but was not storing or sending the associated timeout duration to the backend when launching the draft session.
What user-facing changes did I ship?
User Experience Improvement:
Verification for end users:
opt+yto enable bypass permissionsHow I implemented it
Changes in
DraftLauncherForm.tsx:Added state management for timeout (line 58):
const [savedBypassTimeout, setSavedBypassTimeout] = useState<number | null>(15)nullto represent "no timeout" (indefinite bypass)Updated confirmation handler (lines 566-573):
timeoutMinutesparameter from dialogsetSavedBypassTimeout(timeoutMinutes)Clear timeout when disabling (line 560):
setSavedBypassTimeout(null)Include timeout in launch payload (lines 469-471):
dangerouslySkipPermissionsTimeoutMsto session updatesavedBypassTimeout * 60 * 1000undefinedif no timeout (indefinite bypass)Updated dependencies (line 517):
savedBypassTimeouttohandleLaunchDraftdependenciesHow the backend uses this:
Pattern consistency:
savedAutoAcceptfor similar timeout handlingHow to verify it
Automated Testing
make -C humanlayer-wui checkmake -C humanlayer-wui checkmake -C humanlayer-wui checkmake -C humanlayer-wui buildManual Testing
Test Case 1: Bypass with Timeout (5 minutes)
opt+yhotkeyTest Case 2: Bypass without Timeout (Indefinite)
opt+yto enable bypass permissionsTest Case 3: Toggle Off and On
opt+yagain to disableopt+yto re-enableTest Case 4: Multiple Draft Sessions
Description for the changelog
Draft Launcher - Bypass Permissions Timeout Fix
Fixed a security issue where the bypass permissions timeout value selected in the draft launcher UI was being discarded during draft launch. Bypass permissions would remain enabled indefinitely instead of automatically expiring after the selected duration.
The timeout value is now properly stored and sent to the backend during launch, enabling the automatic expiration feature to work as designed. Sessions now correctly show a countdown timer and automatically disable bypass permissions when the timer expires.
Fixes ENG-2299