Repository navigation
fix: close one-shot agent sessions after command batches - #329
Conversation
Co-authored-by: Artiom Lunev <artiom@browserless.io>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour. WalkthroughThe agent tools accept ChangesAgent session lifetime
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant AgentTool
participant runCommands
participant BrowserSession
AgentTool->>runCommands: execute command batch
runCommands-->>AgentTool: return active session
AgentTool->>BrowserSession: collect downloads
AgentTool->>BrowserSession: close eligible session when keepSessionAlive is false
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The session-lifetime change has coverage for cleanup, recovery, reuse, and token isolation, with no remaining concrete merge-blocking issue. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
A rabbit keeps the session bright Comment |
|
Verification complete: npm test reports 1,040 passing; lint and formatting passed. Live-browser acceptance passes: the unchanged baseline retained one active browser after 1.2 seconds; final one-shot teardown preserved the command result and reached zero active sessions 288 ms after return; default echoed calls preserved cookie and page state. Explicit cleanup reached zero. The failed-download-drain finding is fixed with regression coverage; the reuse-wording observation remains an acknowledged non-blocking follow-up. All five current-head checks pass, no review thread remains unresolved, and the branch has no merge conflicts. Ready for review. |
There was a problem hiding this comment.
Devin Review found 1 potential issue.
1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
Co-authored-by: Artiom Lunev <artiom@browserless.io>
🤖 I have created a release *beep* *boop* --- ## [1.31.0](v1.30.0...v1.31.0) (2026-09-22) ### Features * add Grok public with config and docs AUTO-340 ([#331](#331)) ([2e1aa00](2e1aa00)) * add repetition self-check to browser agent ([#332](#332)) ([6dfe46a](6dfe46a)) * add saveSecret agent command ([#326](#326)) ([4044466](4044466)) * preflight agent capabilities ([#289](#289)) ([0d50246](0d50246)) * report bounded recipe failure reasons ([#327](#327)) ([eaa6be9](eaa6be9)) ### Bug Fixes * close one-shot agent sessions after command batches ([#329](#329)) ([38f8dd9](38f8dd9)) * constrain local upload paths to configured directories ([#330](#330)) ([44e99c5](44e99c5)) * prevent post-secret selector recovery from recommending blocked captures [AUTO-441] ([#328](#328)) ([96f43f0](96f43f0)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: browserless-actions-bot[bot] <186328842+browserless-actions-bot[bot]@users.noreply.github.com>
Summary
Adds an optional
keepSessionAliveflag tobrowserless_agent, defaulting totrueon both standard and compliant surfaces. Set it tofalseto close the browser used by a successful command batch after results and downloads have been collected.The close targets the stored session handle, including calls that did not supply a session ID. Profile-creation and attached sessions retain their existing lifetime. Default multi-turn pooling is unchanged.
Test plan
npm test: 1,040 passing, including session-cache and package-integrity coverage.npm run lint: passed.Live-browser acceptance
Passed against real Chromium with a fresh signup identity and local mock entitlement; no live Stripe calls:
These checks verify browser-session lifecycle, not payment/subscription behavior.
Checklist
Summary by CodeRabbit
New Features
Bug Fixes
Tests