Skip to content

fix(browser): live Developer Mode revocation + restart-safe artifact TTL - #91695

Merged
kshitijk4poor merged 3 commits into
NousResearch:mainfrom
kshitijk4poor:fix/browser-control-devmode-ttl
Aug 21, 2026
Merged

fix(browser): live Developer Mode revocation + restart-safe artifact TTL#91695
kshitijk4poor merged 3 commits into
NousResearch:mainfrom
kshitijk4poor:fix/browser-control-devmode-ttl

Conversation

@kshitijk4poor

Copy link
Copy Markdown
Collaborator

Summary

Closes the two live review blockers from @andrexibiza's #91535 re-review (Developer Mode revocation, restart-safe artifact TTL) plus the double-classification hot-path finding from the post-merge simplify pass.

Blockers 1 and 2 of that review (artifact scope composition, first-profile-wins store) were already fixed in #91535's merged head — the review was written against pre-fix commit 597bc49c65; see commits 2b10313973/7b2b30f587 on main.

Changes

  • gateway/browser_control_broker.py: privileged capability selection (browser_evaluate/browser_cdp) now consults the LIVE developer_mode config on every select() — flipping it off revokes raw CDP/eval from already-attached controllers without restart; on→off and off→on both covered. Explicit bool still pins the gate (tests/multi-tenant). Also removes the dead _artifact_store back-compat property (zero readers).
  • gateway/browser_control_artifacts.py: a fresh ArtifactStore sweeps orphan artifact-id-shaped files and stale *.tmp left by a dead process — receipts are memory-only, so post-restart files were unreachable yet lived forever despite the advertised 300s TTL. Non-artifact-shaped names untouched.
  • gateway/platforms/api_server.py: _turn_transcript_messages classifies each row once via the projection instead of pre-classifying then re-classifying inside _message_response (was 2x/3x full-content flatten per row per run.completed).

Validation

Result
Browser-control suites + router + compaction projection 113 passed
Dev-mode revocation regression on→off revokes attached controller live; off→on unlocks; pinned-bool contract kept
Restart-orphan regression orphan + stale tmp removed, unrelated file kept, fresh store functional
ruff clean

Refs #91535 (salvage of #85351 by @abundantbeing); addresses #91535 (review) (blockers 3–4).

…ection

The global broker snapshotted browser.extension_control.developer_mode once
at construction, so flipping it OFF in config did not revoke raw CDP/eval
from already-attached controllers until process restart — a revocation
failure at the highest-privilege browser surface (blocker 3 of
andrexibiza's NousResearch#91535 review). select() now consults the live config on
every privileged selection (explicit bool still pins for tests); off->on
also unlocks without restart. Regression test drives both directions
against an attached controller. Also drops the dead back-compat
_artifact_store property (zero readers).
Artifact receipts live only in memory, so files left behind by a dead
process were unreachable but persisted forever despite the advertised
300s TTL — a retention failure on the surface meant to be ephemeral
(blocker 4 of andrexibiza's NousResearch#91535 review). A fresh ArtifactStore now
removes every artifact-id-shaped file and stale *.tmp with no index entry
(at construction the index is empty, so all such files are orphans).
Non-artifact-shaped names are untouched. Regression: store -> recreate
store over same root -> orphan+tmp gone, unrelated file kept.
… transcript

_turn_transcript_messages pre-classified every message with
_is_compressed_summary_message (full content flatten + prefix scan), then
_message_response re-ran the same classifier inside its projection --
2x per non-summary row, 3x per summary row on every run.completed emit.
The outer guard was redundant: _message_response already yields
display_kind hidden for pure handoffs. One projection call per row now.
Surfaced by the post-merge simplify re-review of NousResearch#91517/NousResearch#91535.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have tool/browser Browser automation (CDP, Playwright) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants