[DecimalError] Invalid argument: [object Object] #3772

Closed
opened 2026-02-16 17:41:25 -05:00 by yindo · 9 comments
Owner

Originally created by @karthiknish on GitHub (Dec 22, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

Keep getting this on opus 4.5

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Originally created by @karthiknish on GitHub (Dec 22, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description Keep getting this on opus 4.5 ### OpenCode version _No response_ ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System _No response_ ### Terminal _No response_
yindo added the bug label 2026-02-16 17:41:25 -05:00
yindo closed this issue 2026-02-16 17:41:25 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 22, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #5294: claude-opus-4.5 on azure unusable - Similar DecimalError/invalid argument issues with opus 4.5 models
  • #1803: [aws bedrock: anthropic opus 4.1] JSON parsing failed - Related tool validation and JSON parsing errors with Anthropic opus models

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Dec 22, 2025): This issue might be a duplicate of existing issues. Please check: - #5294: claude-opus-4.5 on azure unusable - Similar DecimalError/invalid argument issues with opus 4.5 models - #1803: [aws bedrock: anthropic opus 4.1] JSON parsing failed - Related tool validation and JSON parsing errors with Anthropic opus models Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Dec 22, 2025):

what provider?

Can you share a session?

When does it happen?

Steps to reproduce?

@rekram1-node commented on GitHub (Dec 22, 2025): what provider? Can you share a session? When does it happen? Steps to reproduce?
Author
Owner

@gcacoutinho commented on GitHub (Dec 24, 2025):

I'm getting the same thing.
Just installed opencode on NixOS WSL via nix flakes configuration.
Didn't set up anything else, just tried to run anything and it shows this error.
On free models it shows the thinking process but doesn't execute anything.
I would share the session here but it doesnt show the error there, just the commands I've issued

@gcacoutinho commented on GitHub (Dec 24, 2025): I'm getting the same thing. Just installed opencode on NixOS WSL via nix flakes configuration. Didn't set up anything else, just tried to run anything and it shows this error. On free models it shows the thinking process but doesn't execute anything. I would share the session here but it doesnt show the error there, just the commands I've issued
Author
Owner

@karthiknish commented on GitHub (Dec 24, 2025):

yes had the similar issue as above

@karthiknish commented on GitHub (Dec 24, 2025): yes had the similar issue as above
Author
Owner

@gcacoutinho commented on GitHub (Dec 24, 2025):

Quick update, tried the same thing on Debian WSL and it worked just fine.
Checked the version over on NixOS and it echoes 0.5.28 while Debian shows 1.0.198, apparently the NixOS version is quite old.
Not sure if that's the case for everyone.

edit: the weird thing is that I'm using unstable and my flakes are updated, maybe it has something to do with the WSL release? Not a big OS guy so I'm not sure that makes sense

edit2: not exactly sure what I did, I was trying a bunch of stuff but nix flake update (again) fixed the version and I'm now on 1.0.180 on NixOS and it seems to be working just fine

@gcacoutinho commented on GitHub (Dec 24, 2025): Quick update, tried the same thing on Debian WSL and it worked just fine. Checked the version over on NixOS and it echoes `0.5.28` while Debian shows `1.0.198`, apparently the NixOS version is quite old. Not sure if that's the case for everyone. edit: the weird thing is that I'm using unstable and my flakes are updated, maybe it has something to do with the WSL release? Not a big OS guy so I'm not sure that makes sense edit2: not exactly sure what I did, I was trying a bunch of stuff but nix flake update (again) fixed the version and I'm now on `1.0.180` on NixOS and it seems to be working just fine
Author
Owner

@jakejrichards commented on GitHub (Dec 24, 2025):

+1 I'm seeing this as well. The error shows up as a final message / breaks chats randomly. It's very hard to debug, but I'm able to repro with (and I assume it's related to) the new @ai-sdk/anthropic major version (3.x.x) is installed, not seeing with 2.0.54.

@jakejrichards commented on GitHub (Dec 24, 2025): +1 I'm seeing this as well. The error shows up as a final message / breaks chats randomly. It's very hard to debug, but I'm able to repro with (and I assume it's related to) the new @ai-sdk/anthropic major version (3.x.x) is installed, not seeing with 2.0.54.
Author
Owner

@brandonwisnicki commented on GitHub (Dec 24, 2025):

Architecturally, seems like it would make sense to pin the provider package to a specific version rather than always relying on latest. Otherwise, opencode will be at the mercy of whatever changes are made upstream (in this case a breaking change in ai-sdk).

A workaround right now is to change the provider.npm in the config to file://ABSOLUTE_PATH_TO_BUN_PROJECT/node_modules/@ai-sdk/anthropic where your bun project installs a pinned version rather than relying on the cache's latest version.

@brandonwisnicki commented on GitHub (Dec 24, 2025): Architecturally, seems like it would make sense to pin the provider package to a specific version rather than always relying on `latest`. Otherwise, opencode will be at the mercy of whatever changes are made upstream (in this case a breaking change in ai-sdk). A workaround right now is to change the `provider.npm` in the config to `file://ABSOLUTE_PATH_TO_BUN_PROJECT/node_modules/@ai-sdk/anthropic` where your bun project installs a pinned version rather than relying on the cache's latest version.
Author
Owner

@Locbac commented on GitHub (Dec 26, 2025):

On nix-darwin with nixpkgs at 25.11 and nix-darwin at the same I'm also getting a very old version

❯ opencode -v
0.3.58

Opencode on nixpkgs unstable is at 1.0.180, the interesting thing is that I set it specifically to grab the latest package, but it still is using an old one anyways.
I'm just adding a flake input with opencode itself:
Flake.nix

  inputs = {
    ...
    # OpenCode
    opencode-flake = {
      url = "github:sst/opencode";
      inputs.nixpkgs.follows = "nixpkgs";
    };

  };
  outputs = {
    self,
    ...
    opencode-flake,
    ...
  } ...

Apps.nix

{ 
  pkgs,
  config,
  nixpkgs-unstable,
  opencode-flake,
  ...
}:
{
  environment.systemPackages = with pkgs; [
    inputs.opencode-flake.packages.${pkgs.system}.default
    #(nixpkgs-unstable.legacyPackages.${pkgs.system}.opencode) #This didn't work before.
  ];

@Locbac commented on GitHub (Dec 26, 2025): On nix-darwin with nixpkgs at 25.11 and nix-darwin at the same I'm also getting a very old version ``` ❯ opencode -v 0.3.58 ``` Opencode on nixpkgs unstable is at `1.0.180`, the interesting thing is that I set it specifically to grab the latest package, but it still is using an old one anyways. I'm just adding a flake input with opencode itself: Flake.nix ```nix inputs = { ... # OpenCode opencode-flake = { url = "github:sst/opencode"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self, ... opencode-flake, ... } ... ``` Apps.nix ```nix { pkgs, config, nixpkgs-unstable, opencode-flake, ... }: { environment.systemPackages = with pkgs; [ inputs.opencode-flake.packages.${pkgs.system}.default #(nixpkgs-unstable.legacyPackages.${pkgs.system}.opencode) #This didn't work before. ]; ```
Author
Owner

@rekram1-node commented on GitHub (Dec 26, 2025):

Ah this seems like if you are on older version before we started pinning the provider packages (we had some built in but only recently did we include all of them, others were dynamically installed)

If u upgrade to more recent versions this should be fixed.

@rekram1-node commented on GitHub (Dec 26, 2025): Ah this seems like if you are on older version before we started pinning the provider packages (we had some built in but only recently did we include all of them, others were dynamically installed) If u upgrade to more recent versions this should be fixed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3772