@really-knows-ai/foundry 3.2.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,6 +29,7 @@ function listModels(worktree) {
29
29
  cwd: worktree,
30
30
  encoding: 'utf8',
31
31
  stdio: ['pipe', 'pipe', 'pipe'],
32
+ env: { ...process.env, FOUNDRY_SKIP_BOOTSTRAP: '1' },
32
33
  });
33
34
  return stdout
34
35
  .split('\n')
@@ -131,6 +131,18 @@ function runConfigBootstrap(worktree, pkgRoot) {
131
131
  return changed || guideWritten;
132
132
  }
133
133
 
134
+ function runPluginBootstrap(worktree, pkgRoot) {
135
+ // Skip if FOUNDRY_SKIP_BOOTSTRAP is set to prevent infinite recursion
136
+ // when this plugin spawns `opencode models` as a child process.
137
+ if (process.env.FOUNDRY_SKIP_BOOTSTRAP === '1') return false;
138
+ try {
139
+ return runConfigBootstrap(worktree, pkgRoot);
140
+ } catch (err) {
141
+ console.error('Foundry bootstrap error:', err.message);
142
+ return false;
143
+ }
144
+ }
145
+
134
146
  export { buildCyclePromptExtras } from './foundry-tools/helpers.js';
135
147
 
136
148
  function buildTools(createTool, pending) {
@@ -181,12 +193,7 @@ export const FoundryPlugin = async ({ directory }) => {
181
193
  config.skills.paths.push(allSkillsDir);
182
194
  }
183
195
 
184
- // Boot decision tree: bootstrap or detect changes, then set restart flag
185
- try {
186
- restartNeeded = runConfigBootstrap(directory, packageRoot);
187
- } catch (err) {
188
- console.error('Foundry bootstrap error:', err.message);
189
- }
196
+ restartNeeded = runPluginBootstrap(directory, packageRoot);
190
197
  },
191
198
 
192
199
  'experimental.chat.messages.transform': async (_input, output) => {
package/dist/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.2.1] - 2026-05-14
4
+
5
+ ### Fixed
6
+
7
+ - **Plugin hangs on startup due to infinite recursion.** The config hook's
8
+ `refreshAgents` call spawns `opencode models` via `execFileSync`. When the
9
+ project directory has the foundry plugin configured, the child process
10
+ loads plugins too, triggering another `opencode models` — infinite
11
+ synchronous recursion that hangs the parent. The plugin now sets
12
+ `FOUNDRY_SKIP_BOOTSTRAP=1` in the child process environment and skips the
13
+ bootstrap in the config hook when that variable is set.
14
+
3
15
  ## [3.2.0] - 2026-05-14
4
16
 
5
17
  Plugin auto-bootstrapping release. Foundry now ensures the guide agent is
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@really-knows-ai/foundry",
3
- "version": "3.2.0",
3
+ "version": "3.2.1",
4
4
  "description": "A skill-driven framework for governed artefact generation with AI coding tools. Define your own artefact types, laws, and flows — Foundry handles the forge → quench → appraise pipeline with deterministic routing, quality gates, and iterative refinement.",
5
5
  "type": "module",
6
6
  "main": "dist/.opencode/plugins/foundry.js",