Skip to content

fix(environment): retry skill preview after a report refresh - #1330

Merged
nixuuu merged 1 commit into
devfrom
fix/retry-changed-report-snapshot
Nov 27, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/retry-changed-report-snapshot

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 27, 2026

Copy link
Copy Markdown
Member

Summary

  • Read the worker snapshot once more when the accepted report changes during local skill preview on the same connection. Validate the original revision and copy token against the new snapshot before contacting the worker.
  • Add an integration test that accepts an identical report during the read and checks the previewed bytes. Update the agent environment documentation.

Push CI #146 and #147 reported the same FAILED_PRECONDITION. The controlled regression reproduces that error. The original CI logs do not identify which validation condition rejected those requests.

Verification

  • The new integration test failed with FAILED_PRECONDITION before the fix and passed afterwards.
  • Four focused integration cases passed via check:tmp, including rejection of an on-disk change and preview through a linked computer.
  • Lint and formatting passed for the two edited TypeScript files. git diff --check passed.
  • The remaining repository checks run in GitHub CI.

Fixes: #1303

@nixuuu
nixuuu enabled auto-merge (squash) November 27, 2026 09:04
@nixuuu
nixuuu merged commit d56fbef into dev Nov 27, 2026
45 of 47 checks passed
@nixuuu
nixuuu deleted the fix/retry-changed-report-snapshot branch November 27, 2026 09:19
nixuuu added a commit that referenced this pull request Nov 27, 2026
…1341)

## Changes

The gateway dropped a connection's accepted skill report as soon as a
new report arrived and restored it only after the database write. A
preview that read during that window saw no accepted report and blanked
copy tokens, so it failed with "This skill copy changed" even though the
worker re-sent an identical inventory. Workers repeat their report on
every environment sync (connect, CLI tool reports, config changes), so
this hit the linked-computer preview test in Push CI and real users.

Keep the previous acceptance until the new report is stored or
rejected, and store its revision and copy tokens. The preview checks
that report after reading the snapshot, so an identical repeat passes
and a report with a changed copy stored during the read still rejects.
This replaces the single re-read added in #1330, which covered only a
report that finished during the first read.

Fixes: #1303
Related: #1330

## Verification

- Reproduced on current `dev` (with #1330) by firing extra environment
refreshes before the preview: 1 failure in 4 runs. After the fix: 12/12.
- `agent-skills` and `config-sync-environment` passed 6 times through
`check:tmp` (26/26 each).
- Gateway and integration typecheck, oxlint and oxfmt on edited files.
Copy audit: no UI text changed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

1 participant