Conversation
packages/core/src/filesystem.ts captures FileSystemSearch.node in its layer deps at module scope, while filesystem/search.ts imports ../filesystem at runtime. When the bundle evaluates search.ts first, FileSystemSearch.node is still undefined, so every prompt dies in the layer-tree walk (recur -> resolve -> node.name on undefined) and surfaces as 'Unexpected server error'. Make the search.ts import type-only and take the Entry/Match values straight from @opencode-ai/schema/filesystem (the same objects core re-exports), removing the runtime edge.
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate Found:
Related PRs that may be relevant context:
Recommendation: Check if PR #48877 was closed or if this is a reopened/revised attempt at the same fix. If PR #48877 is still open, this is likely a duplicate that should reference or potentially be combined with that PR. |
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
Every prompt on the nixpkgs build (1.18.30, 1.18.31) dies before the model call with
TypeError: undefined is not an object (evaluating 'node.name'), surfaced as 'Unexpected server error' (ref err_* in server logs).Root cause:
packages/core/src/filesystem.tscapturesFileSystemSearch.nodein its layer deps at module scope, whilefilesystem/search.tsimports../filesystemat runtime. When the bundle evaluatessearch.tsfirst, the namespace is still uninitialized, so the dep is captured asundefinedand the layer-tree walk (walk/recur->resolve->node.name) throws on first use viaAgent.defaultInfo. (Minified stacks misattribute it toSystemPrompt.environment; an unminified build shows the trueAgent.statepath.)Fix: make the
search.tsimport type-only and take theEntry/Matchvalues straight from@opencode-ai/schema/filesystem(the same objects core re-exports). No behavior change; verified a bundle built from the patched source answers prompts again.