Skip to content

Turn one illustration into an animated 2D mesh avatar with a coding agent and a local editor

fix: do not let uv pick a free-threaded python for the tool runner

bluzername8090e7ddb75e
diff --git a/.changeset/uv-python-constraint.md b/.changeset/uv-python-constraint.md
new file mode 100644
index 0000000..f15c3ea
--- /dev/null
+++ b/.changeset/uv-python-constraint.md
@@ -0,0 +1,5 @@
+---
+'mesh-avatar-studio': patch
+---
+
+Pin the local tool runner's `uv --python` request below 3.14 so it cannot resolve to a free-threaded interpreter that `opencv-python-headless` has no wheel for.
diff --git a/src/server/project-jobs.ts b/src/server/project-jobs.ts
index aa4435c..7a841cc 100644
--- a/src/server/project-jobs.ts
+++ b/src/server/project-jobs.ts
@@ -9,8 +9,13 @@ export class JobError extends Error {
constructor(public code: 'dependencies' | 'toolFailed' | 'unsafeFiles', public log: string) { super(code); }
}
export type Runner = (root: string, project: string, tool: Tool) => Promise<string>;
+// opencv-python-headless has no prebuilt wheel for free-threaded builds, so an
+// unconstrained ">=3.10" can resolve to a managed cpython-3.14+freethreaded
+// interpreter (uv's newest match on a machine with nothing cached yet) and fail
+// the pip install. CI already pins 3.12 for the same reason; keep this in sync.
+const PYTHON_SPEC = '>=3.10,<3.14';
export const runTool: Runner = (root, project, tool) => new Promise((done, reject) => {
- const args = ['run', '--no-project', '--no-python-downloads', '--python', '>=3.10', '--with', 'numpy', '--with', 'pillow', '--with', 'opencv-python-headless', resolve(root, `tools/${tool}.py`), project];
+ const args = ['run', '--no-project', '--no-python-downloads', '--python', PYTHON_SPEC, '--with', 'numpy', '--with', 'pillow', '--with', 'opencv-python-headless', resolve(root, `tools/${tool}.py`), project];
execFile('uv', args, { cwd: root, timeout: 120_000, maxBuffer: 2 * 1024 * 1024 }, (error, stdout, stderr) => {
const log = `${stdout}\n${stderr}`.replaceAll(root, '<repo>').replaceAll(homedir(), '~').trim().slice(-12000);
if (!error) { done(log); return; }
diff --git a/tests/project-jobs.test.ts b/tests/project-jobs.test.ts
index 0e4124a..08c8135 100644
--- a/tests/project-jobs.test.ts
+++ b/tests/project-jobs.test.ts
@@ -103,7 +103,7 @@ test('tools use execFile with a fixed argument array, and missing dependencies r
(args[3] as (error: Error | null, stdout: string, stderr: string) => void)(null, 'complete', ''); return {} as ReturnType<typeof execFile>;
});
expect(await runTool(root, project, 'build-layers')).toBe('complete');
- expect(execute).toHaveBeenCalledWith('uv', ['run', '--no-project', '--no-python-downloads', '--python', '>=3.10', '--with', 'numpy', '--with', 'pillow', '--with', 'opencv-python-headless', resolve(root, 'tools/build-layers.py'), project], expect.objectContaining({ cwd: root, timeout: 120000 }), expect.any(Function));
+ expect(execute).toHaveBeenCalledWith('uv', ['run', '--no-project', '--no-python-downloads', '--python', '>=3.10,<3.14', '--with', 'numpy', '--with', 'pillow', '--with', 'opencv-python-headless', resolve(root, 'tools/build-layers.py'), project], expect.objectContaining({ cwd: root, timeout: 120000 }), expect.any(Function));
execute.mockImplementation((...args: unknown[]) => {
(args[3] as (error: Error, stdout: string, stderr: string) => void)(Object.assign(new Error('not installed'), { code: 'ENOENT' }), '', ''); return {} as ReturnType<typeof execFile>;
});