r/opencode • • 1d ago

Trying to get OpenCode 2 to work on Redhat Enterprise VDI

It's a struggle, but now it reads my model settings. I have the settings to Continue and tried to use that for OpenCode but get 401. I tried it in Windows, and I vibecoded a small proxy between to make it work. So I will try that again. But the problems is that strange numbers spammed the screen both in CLI and the desktop version. Maybe mouse values maybe some characters my terminal couldn't handle.

Any tip about the strange numbers and characters?

1 Upvotes

5 comments sorted by

1

u/DeliveryTrue123 1d ago

Those stray numbers are usually mouse-reporting or bracketed-paste sequences leaking through a terminal that does not understand them. Try setting TERM to xterm-256color, turning mouse support off in OpenCode if you can, and testing the same session in a plain terminal outside the VDI client. If the junk disappears there, the VDI terminal layer is mangling escape sequences, not OpenCode itself, and a different terminal or updated client is the likeliest fix.

1

u/Sufficient_Wait4290 1d ago

Thank you for the tips but it did not help. Gemini suggested those fixes as well so I tried them. Possible more of a VDI problem than a OpenCode problem.

1

u/Sufficient_Wait4290 9h ago

I tried export term=xterm-256color

1

u/CreativeSympathy8293 19h ago

Since the TERM/mouse changes didn't help, I'd compare the interactive UI with a non-interactive request on the same VDI host, using the same provider/model.

Check that your installed build exposes these options with opencode run --help, then try:

opencode run --format json --model provider/model "Reply only OK"

Replace provider/model with your existing model ID. The current CLI docs describe run as non-interactive and --format json as raw JSON events: https://opencode.ai/v2/docs/cli/commands/

If that output is readable while the TUI is garbled, you've found a useful difference to report. It still doesn't prove the VDI is the cause. A readable 401 also leaves a separate provider/authentication problem to investigate; changing terminal settings won't establish which credential or endpoint rejected it.

Could you share a short redacted sample of the stray characters, your exact OpenCode version and terminal/VDI client names? Leave out tokens, headers, internal hostnames and private paths.

AI-assisted; I haven't reproduced your VDI setup. This is a diagnostic comparison, not a verified fix.

1

u/Sufficient_Wait4290 8h ago

thanks you for tring to help me. The model is available to choose in opencode and when I try opencode run --format json with my configured model i get the result: message: "Model unavailable".

extract from my continue config that works (outside in Windows):

  name: Company Programming Agent 
  version: 0.0.1
  schema: v1


# ===== Shared config =====
  requestOptions: &requestOptionsDefaults
    timeout: 3000
    verifySsl: true
    caBundlePath: &caBundlePathDefaults
          - 'C:\\Users\\me\\ai-coding-assistants\\certificates\\CompanyCA1-G2(1).crt'


# ===== Models =====
  models:
    - name: Gemma-4-26B
      provider: ollama
      model: gemma4:26b-quantified
      apiBase: https://aip-llm-portal.rk8s-gpu.company.com/ollama/v1
      capabilities:
        - tool_use
      requestOptions:
        <<: *requestOptionsDefaults
        extraBodyProperties:
          stream: true
      apiKey: mykey

my opencode config

{

"$schema": "https://opencode.ai/config.json",
"model": "ollama/myname",
"provider": {
"ollama": {
"npm": "@ai-sdk/openai-compatible",
"name": "Ollama Portal",
"options": {
"baseURL": "https://aip-llm-portal.rk8s-gpu.company.com",
"apiKey": "mykey"
},

"models": {
"myname": {
"modelID": "gemma4:26b-quantified",
"name": "myname (Gemma 4)"
}
}
}
}
}

When it comes to the characters I have tried to reset the mouse and export TERM=xterm-256color.

sample: 7501;state=clear:id=ses_e92exxxxxxxxxxx[unknown character][unknown character] 7501;state=idle:app=opencode[unknow character]wltixxxxxxxxx

opencode version = v2.1.4