Skip to content

fix: improve error logging in worker and update defaultLayer evaluation closes #20413#20413

Open
arafays wants to merge 16 commits intoanomalyco:betafrom
arafays:fix/worker-crash-from-eager-Provider.defaultLayer-evaluation
Open

fix: improve error logging in worker and update defaultLayer evaluation closes #20413#20413
arafays wants to merge 16 commits intoanomalyco:betafrom
arafays:fix/worker-crash-from-eager-Provider.defaultLayer-evaluation

Conversation

@arafays
Copy link
Copy Markdown

@arafays arafays commented Apr 1, 2026

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Running opencode with --conditions=browser shows a blank screen, freezes completely, Ctrl+C doesn't work, terminal must be killed. The error log only shows [object ErrorEvent].

  • thread.tsworker.onerror passed raw ErrorEvent to logger. Used existing errorMessage utility instead.
  • agent.tsdefaultLayer eagerly accessed Provider.defaultLayer at module load time, which is undefined under --conditions=browser. Wrapped with Effect.sync + Layer.unwrap following the pattern in src/session/compaction.ts:382-394.

How did you verify your code works?

Before: blank screen, Ctrl+C unresponsive. After: launches cleanly. Ran bun run typecheck and bun run dev.

Screenshots / recordings

Not applied

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Issue for this PR

Closes #20413

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions bot added needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels Apr 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found one potentially related PR:

PR #12809: fix(opencode): expand Error properties in logs for better diagnostics

All other searches either returned only the current PR (#20413) or no results, suggesting there are no other open PRs addressing the same issues (worker error logging with ErrorEvent, defaultLayer deferred evaluation for --conditions=browser, or the blank screen problem).

@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Apr 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@github-actions github-actions bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Apr 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@github-actions github-actions bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Apr 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@arafays
Copy link
Copy Markdown
Author

arafays commented Apr 1, 2026

this pr closes #20413 i dont know why the label is not removed I have tried to edit multiple times

@arafays arafays changed the title fix: improve error logging in worker and update defaultLayer evaluation fix: improve error logging in worker and update defaultLayer evaluation closes #20413 Apr 1, 2026
@opencode-agent opencode-agent bot requested a review from adamdotdevin as a code owner April 1, 2026 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant