Skip to content

fix(core): break filesystem cycle in compiled prompts - #48397

Draft
kernel-oops wants to merge 1 commit into
anomalyco:devfrom
kernel-oops:compiled-filesystem-cycle
Draft

fix(core): break filesystem cycle in compiled prompts#48397
kernel-oops wants to merge 1 commit into
anomalyco:devfrom
kernel-oops:compiled-filesystem-cycle

Conversation

@kernel-oops

@kernel-oops kernel-oops commented Sep 10, 2026

Copy link
Copy Markdown

Issue for this PR

Related to #44946; no separate issue. This complements that Bun upgrade rather than duplicating its runtime pin change. The upgrade is useful for fixes such as oven-sh/bun#35356 (GC timer CPU usage), but compiled prompt preparation also needs checking.

Type of change

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

What does this PR do?

Remove the runtime import from filesystem search back to the filesystem service. Schema constructors now come directly from the schema package; service input imports remain type-only.

The service depends on the search node. With Bun 1.4.2, the compiled cycle can capture an undefined dependency: health passes, but the first prompt fails in SystemPrompt.environment with TypeError: undefined is not an object (evaluating 'a.name'), before any provider request.

Add an isolated compiled regression and a path-filtered Linux CI job using Bun 1.4.2. The runner exercises authenticated session creation, a streamed request for the actual read tool, completion, persisted tool output and a second turn. All provider responses are deterministic and local.

How did you verify your code works?

Fresh upstream dev at 193de13a88d62a6409c6d385831180f1def527dc, Linux x64/glibc, Bun 1.4.2, native minified/split builds with embedded web UI:

  • Before: health passes; first prompt fails with the error above; zero provider requests.
  • After: compiled regression passes; exactly three provider requests. The embedded runtime is checked by the runner.
  • Frozen-lockfile installation; no lockfile changes.
  • Core filesystem/location/read tests: 46 pass, also 46 pass with FFF disabled.
  • Isolated processor/permission/config/storage tests: 345 pass, 3 platform skips. An initial run inherited local configuration and failed; the clean-environment rerun passed.
  • Core and OpenCode typechecks, formatting, Python syntax, workflow YAML and inline shell checks pass.

Draft pending upstream CI/review and broader platform/soak coverage. Windows runner support, other binary targets, real providers and CPU benchmarks were not tested here.

Screenshots / recordings

Not applicable.

Checklist

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

Fixes #48372

@github-actions

Copy link
Copy Markdown
Contributor

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.

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.

SystemPrompt.environment

1 participant