Repository navigation
Closed
Description
Description
Saw lot of issues opened but no one provided logs cleanly, soo here it goes:
miguvt@nixos /e/nixos (main) [1]> opencode --print-logs --log-level DEBUG run "hi"
timestamp=2026-09-16T16:37:39.336Z level=INFO run=d2699f38 message="creating instance" directory=/etc/nixos
timestamp=2026-09-16T16:37:39.337Z level=INFO run=d2699f38 message=fromDirectory directory=/etc/nixos
timestamp=2026-09-16T16:37:39.359Z level=INFO run=d2699f38 message=bootstrapping directory=/etc/nixos
timestamp=2026-09-16T16:37:39.365Z level=INFO run=d2699f38 message=loading path=/home/miguvt/.config/opencode/config.json
timestamp=2026-09-16T16:37:39.366Z level=INFO run=d2699f38 message=loading path=/home/miguvt/.config/opencode/opencode.json
timestamp=2026-09-16T16:37:39.369Z level=INFO run=d2699f38 message=loading path=/home/miguvt/.config/opencode/opencode.jsonc
timestamp=2026-09-16T16:37:39.418Z level=INFO run=d2699f38 message="all LSPs are disabled"
timestamp=2026-09-16T16:37:39.419Z level=INFO run=d2699f38 message="all formatters are disabled"
timestamp=2026-09-16T16:37:39.419Z level=INFO run=d2699f38 message=init
timestamp=2026-09-16T16:37:39.499Z level=INFO run=d2699f38 message=created id=ses_f54eb3dd4ffeYaX03UHFdIWDrD slug=hidden-orchid version=1.18.30 projectID=d310466c572f92051e7d9b1b3733725e3eaa20d8 directory=/etc/nixos path="" workspaceID=undefined parentID=undefined title="New session - 2026-09-16T16:37:39.499Z" agent=undefined model=undefined metadata=undefined permission="[{\"permission\":\"question\",\"pattern\":\"*\",\"action\":\"deny\"},{\"permission\":\"plan_enter\",\"pattern\":\"*\",\"action\":\"deny\"},{\"permission\":\"plan_exit\",\"pattern\":\"*\",\"action\":\"deny\"}]" cost=0 tokens.input=0 tokens.output=0 tokens.reasoning=0 tokens.cache.read=0 tokens.cache.write=0 time.created=1789576659499 time.updated=1789576659499
timestamp=2026-09-16T16:37:39.507Z level=INFO run=d2699f38 message="event connected"
timestamp=2026-09-16T16:37:39.767Z level=INFO run=d2699f38 message=loop session.id=ses_f54eb3dd4ffeYaX03UHFdIWDrD step=0
> build · qwen3.8-27b
timestamp=2026-09-16T16:37:39.773Z level=INFO run=d2699f38 message=stream providerID=local-llama modelID=qwen3.8-27b session.id=ses_f54eb3dd4ffeYaX03UHFdIWDrD small=true agent=title mode=primary
timestamp=2026-09-16T16:37:39.781Z level=INFO run=d2699f38 message="llm runtime selected" llm.runtime=ai-sdk llm.provider=local-llama llm.model=qwen3.8-27b
timestamp=2026-09-16T16:37:39.790Z level=ERROR run=d2699f38 message="stream error" providerID=local-llama modelID=qwen3.8-27b session.id=ses_f54eb3dd4ffeYaX03UHFdIWDrD small=true agent=title mode=primary error.error="AI_APICallError: Invalid API Key"
timestamp=2026-09-16T16:37:39.797Z level=INFO run=d2699f38 message=tracking hash=647a091fe6ceca3693968f6310e72bf508b75def cwd=/etc/nixos git=/home/miguvt/.local/share/opencode/snapshot/d310466c572f92051e7d9b1b3733725e3eaa20d8/8662e97f990aad1524085c760436e71142424611
timestamp=2026-09-16T16:37:39.801Z level=INFO run=d2699f38 message="shell tool using shell" shell=/run/current-system/sw/bin/bash
timestamp=2026-09-16T16:37:39.806Z level=INFO run=d2699f38 message=init count=1
timestamp=2026-09-16T16:37:39.808Z level=ERROR run=d2699f38 message=failed ref=err_07558542 error="TypeError: undefined is not an object (evaluating 'a.name')" cause="TypeError: undefined is not an object (evaluating 'a.name')\n at resolve (/$bunfs/root/chunk-2txybz4b.js:2:1659)\n at a (/$bunfs/root/chunk-2txybz4b.js:2:936)\n at map (native:1:11)\n at <anonymous> (/$bunfs/root/chunk-2txybz4b.js:2:1626)\n at a (/$bunfs/root/chunk-2txybz4b.js:2:1166)\n at map (native:1:11)\n at <anonymous> (/$bunfs/root/chunk-2txybz4b.js:2:1626)\n at a (/$bunfs/root/chunk-2txybz4b.js:2:1166)\n at map (native:1:11)\n at <anonymous> (/$bunfs/root/chunk-2txybz4b.js:2:1390)\n at SystemPrompt.environment (/$bunfs/root/chunk-bea263sy.js:50:13096)\n at SystemPrompt.environment (definition) (/$bunfs/root/chunk-bea263sy.js:4:14254)\n at SessionPrompt.run (/$bunfs/root/chunk-bea263sy.js:50:14576)\n at SessionPrompt.run (definition) (/$bunfs/root/chunk-bea263sy.js:50:10099)\n at SessionRunState.ensureRunning (/$bunfs/root/chunk-bea263sy.js:50:14545)\n at SessionRunState.ensureRunning (definition) (/$bunfs/root/chunk-bea263sy.js:2:6720)\n at SessionPrompt.loop (/$bunfs/root/chunk-bea263sy.js:50:9849)\n at SessionPrompt.loop (definition) (/$bunfs/root/chunk-bea263sy.js:50:14481)\n at SessionPrompt.prompt (/$bunfs/root/chunk-f9g4vqca.js:6:11695)\n at SessionPrompt.prompt (definition) (/$bunfs/root/chunk-bea263sy.js:50:9462)"
Error: {
"name": "UnknownError",
"data": {
"message": "Unexpected server error. Check server logs for details.",
"ref": "err_07558542"
}
}
timestamp=2026-09-16T16:37:39.809Z level=INFO run=d2699f38 message="disposing instance" directory=/etc/nixos
miguvt@nixos /e/nixos (main) [1]>
While my config is:
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
(llama-cpp.override { cudaSupport = true; })
opencode
];
environment.sessionVariables = {
AI_MODELS_PATH = "/mnt/data/llamasrv/Models";
};
networking.firewall.allowedTCPPorts = [
8001 # llama-server
];
home-manager.users.miguvt = {
xdg.configFile."opencode/opencode.json".text = builtins.toJSON {
"$schema" = "https://opencode.ai/config.json";
"provider" = {
"local-llama" = {
"npm" = "@ai-sdk/openai-compatible";
"name" = "Local Llama Server";
"options" = {
"baseURL" = "http://127.0.0.1:8001/v1";
};
"models" = {
"qwen3.8-27b" = {
"name" = "qwen3.8-27b (local)";
};
};
};
};
"tools" = {
"bash" = true;
"edit" = true;
"write" = true;
"read" = true;
};
};
};
}
Plugins
Default
OpenCode version
1.18.30
Steps to reproduce
- Just run opencode run "hi"
Screenshot and/or share link
https://opncd.ai/share/pF86jcEq
Operating System
NixOS Unstable
Terminal
Kitty
Metadata
Metadata
Assignees
Labels
No labels
Activity
github-actions commentedon Sep 16, 2026
This issue might be a duplicate of existing issues. Please check:
MiguVT commentedon Sep 16, 2026
Its true that all of them are duplicated, but all of them are just people repeating things and amking everything harder to understand, here I tried to give everything as KISS (Keep It Simple Stupid) as possible to make it easy to follow.
GanbaruTobi commentedon Sep 16, 2026
Having the same issue
ApprenticeofEnder commentedon Sep 17, 2026
Same thing, plus I'm using Nix too, just on Nobara linux.
vacy commentedon Sep 18, 2026
issue at bun repository oven-sh/bun#42632
pbek commentedon Sep 19, 2026
My workaround is pinning to an old version of bun: pbek/nixcfg@bf0bce8
lfos commentedon Sep 23, 2026
We (Arch Linux packagers) have reported this upstream at oven-sh/bun#42632 as @vacy has already pointed out and temporarily pinned bun to 1.4.0 in our opencode package.
MiguVT commentedon Sep 23, 2026
Works well on OpenCode v2, here is how I managed to install OpenCode v2 on git.miguvt.com - my own forgejo instance or if you guys prefer github MiguVT/nixos-config-mirror@fd4720a
zevisert commentedon Sep 23, 2026
For other nix users, here's a similar solve to @MiguVT's - just using overrideAttrs instead of redefining the whole derivation:
Overlays for both bun 1.4.0 and opencode 2.0.15
MiguVT commentedon Sep 23, 2026
Nice overlay! Honestly, I just went with the binary route to avoid source-build headaches. Dealing with
node_moduleshashes and updating build dependencies across major versions can get pretty tedious, so grabbing the prebuilt binary just saves a ton of friction.opencode-agent commentedon Oct 1, 2026
This crash affected downstream builds compiled with newer Bun 1.4 versions and code splitting enabled. OpenCode’s release build remained pinned to Bun 1.3.14. The newer bundler ordering exposed a runtime import cycle between
filesystem.tsandfilesystem/search.ts, leaving a layer dependency undefined before a provider request.We removed that cycle in #50439. The source fix shipped in v1.18.32; downstream packages need to be rebuilt from v1.18.32 or later to include it. We’re closing this report as fixed. If a build from that source still produces the same stack, please share its Bun build version and relevant log.