Skip to content

fix: suppress expected lazy skill read errors in traces#3891

Closed
Sakshamm-Goyal wants to merge 2 commits into
openai:mainfrom
Sakshamm-Goyal:fix/lazy-skill-expected-read-trace
Closed

fix: suppress expected lazy skill read errors in traces#3891
Sakshamm-Goyal wants to merge 2 commits into
openai:mainfrom
Sakshamm-Goyal:fix/lazy-skill-expected-read-trace

Conversation

@Sakshamm-Goyal

Copy link
Copy Markdown

Summary

Lazy skill materialization probes for SKILL.md before copying a skill into the workspace. A first load expects that read to be absent, but SandboxSession recorded the caught WorkspaceReadNotFoundError as a failed sandbox.read span.

This change scopes expected-error telemetry to that probe only, so the read still raises to the loader and triggers materialization, while its completion event and span no longer carry an error. Other missing reads retain their normal error telemetry.

Test plan

  • uvx --from uv>=0.10.0 uv sync --all-extras --all-packages --group dev
  • uvx --from uv>=0.10.0 uv run make format
  • uvx --from uv>=0.10.0 uv run make lint
  • uvx --from uv>=0.10.0 uv run make typecheck
  • uvx --from uv>=0.10.0 uv run make tests

Issue number

Closes #3889

Checks

  • Added relevant regression coverage
  • Ran the code-change verification sequence
  • Confirmed formatter, lint, typecheck, and tests pass
  • Ran Codex review before submission

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d49a1d8b84

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +240 to +241
with expected_sandbox_error(WorkspaceReadNotFoundError):
handle = await session.read(skill_md_path, user=user)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Suppress raw FileNotFoundError probes too

For sandbox clients or injected sessions that implement BaseSandboxSession.read as documented and raise FileNotFoundError for a missing path, this probe is still treated as a failed sandbox.read event/span even though the next line catches FileNotFoundError as the expected lazy-load miss. Built-in backends mostly wrap this as WorkspaceReadNotFoundError, but custom backends following the base contract will still produce the false error telemetry this change is trying to eliminate.

Useful? React with 👍 / 👎.

@seratch

seratch commented Jul 20, 2026

Copy link
Copy Markdown
Member

Thanks for sharing this idea. The issue was resolved by #3893

@seratch seratch closed this Jul 20, 2026
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.

Lazy skill first load records expected WorkspaceReadNotFoundError as a failed span

2 participants