Skip to content

fix(demo): wait out the trust race instead of configuring it away - #28

Merged
RodolpheKouyoumdjian merged 1 commit into
mainfrom
fix/trust-race-before-postattach
Sep 11, 2026
Merged

RodolpheKouyoumdjian merged 1 commit into
mainfrom
fix/trust-race-before-postattach

Conversation

@RodolpheKouyoumdjian

Copy link
Copy Markdown
Contributor

Follow-up to #27, which did not work.

Why #27 could not work

security.workspace.trust.enabled / .startupPrompt / .banner are user-scope by design — VS Code ignores them from devcontainer.json, remote and workspace settings (docs, vscode#147736). A fresh Codespace built from 97d68c5 raised the same modal and sat in Restricted Mode. The keys are removed rather than left looking like a fix.

What actually happens

Creating a terminal counts as executing code. When postAttachCommand starts one before Codespaces has finished granting trust, VS Code asks "Do you trust the authors of the files in this folder?", and while that modal stands the extension never activates (untrustedWorkspaces.supported: false): no panel, no analysis, no terminal.

Observed 2026-09-11: two of three fresh Codespaces hit it; the one that did not had simply attached more slowly — which is the shape of a race, and the reason this is worth mitigating rather than ignoring.

This PR

  • postAttachCommand: sleep 10 && drift analyze < /dev/null — the terminal waits for trust to settle, using time the demo was already spending on its first analysis.
  • DEMO.md tells the visitor what to click if the prompt appears anyway, since a wait is a mitigation and not a guarantee.

All 16 devcontainers and DEMO.md files regenerated; check-demos.mjs passes.

🤖 Generated with Claude Code

The settings shipped in #27 cannot work: `security.workspace.trust.*` is
user-scope by design and VS Code ignores it from devcontainer, remote and
workspace settings. A fresh Codespace built from that commit raised the same
modal, so the three keys are removed rather than left in place looking like a
fix.

What actually triggers the prompt is timing. Creating a terminal counts as
executing code, so a `postAttachCommand` terminal that starts before Codespaces
has finished granting trust makes VS Code ask, and while that modal stands the
extension never activates: no panel, no analysis, no terminal. Two of three
Codespaces opened on 2026-09-11 hit it; the third had simply attached more
slowly. The startup terminal now waits ten seconds first — time the demo was
already spending on its first analysis.

A wait is a mitigation, not a guarantee, so DEMO.md now says what to click if
the question appears anyway.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 11, 2026 23:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@RodolpheKouyoumdjian
RodolpheKouyoumdjian merged commit d32803c into main Sep 11, 2026
1 check passed
@RodolpheKouyoumdjian
RodolpheKouyoumdjian deleted the fix/trust-race-before-postattach branch September 11, 2026 23:02
RodolpheKouyoumdjian added a commit that referenced this pull request Sep 11, 2026
Four fresh Codespaces on 2026-09-11 all opened untrusted and all raised "Do you
trust the authors of the files in this folder?" as soon as the startup terminal
asked to execute code. The ten-second wait added in #28 did not prevent it — it
only moved the same modal later, after a pause in which the demo looked broken.

So the terminal starts immediately again. The question arrives at once, DEMO.md
says what to click, and nothing here pretends the prompt is avoidable: an
earlier attempt via `security.workspace.trust.*` was ignored because those keys
are user-scope by design.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants