public inbox for kaagum@systemreboot.net
 help / color / mirror / Atom feed
* connecting to bifrost over SOCKS5 proxy fails
@ 2026-11-02 19:54 Ricardo Wurmus
  2026-11-03  0:43 ` Arun Isaac
  0 siblings, 1 reply; 3+ messages in thread
From: Ricardo Wurmus @ 2026-11-02 19:54 UTC (permalink / raw)
  To: kaagum

Hi,

thank you for kaagum.  I'm trying to use it with a bifrost 
installation on a network that I can only access with an SSH 
tunnel.  I've configured agent-shell like so:

--8<---------------cut here---------------start------------->8---
(require 'agent-shell-kaagum)

(setq agent-shell-kaagum-command "proxychains4"
      agent-shell-kaagum-parameters
      '("-f" "/path/to/proxychains.conf"
        "/path/to/bin/kaagum"
        "--api-base-uri=https://llm.example.net"
        "--api-key-command=gpg -dq /path/to/password.gpg"
        "--model=vllm/Qwen/Qwen3.8-27B"))

(add-to-list 'agent-shell-agent-configs
             (agent-shell-kaagum-make-agent-config))
--8<---------------cut here---------------end--------------->8---

This seems to work fine up to the first request from the agent 
shell:

--8<---------------cut here---------------start------------->8---
[proxychains] config file found: /path/to/proxychains.conf
[proxychains] preloading 
/gnu/store/djhjgy1j0iqd317pmgazv9wng249q0df-proxychains-ng-4.17/lib/libproxychains4.so
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] Strict chain  ...  127.0.0.1:8022  ... 
llm.example.net:443  ...  OK
Backtrace:
In ice-9/boot-9.scm:
  1791:12  9 (with-exception-handler _ _ #:unwind? _ 
  #:unwind-for-type _)
In unknown file:
           8 (apply-smob/0 #<thunk 7fde38d193a0>)
In ice-9/boot-9.scm:
    740:2  7 (call-with-prompt _ _ #<procedure 
    default-prompt-handler (k proc)>)
In ice-9/eval.scm:
    619:8  6 (_ #(#(#<directory (guile-user) 7fde38d1cc80>)))
In kaagum/tea.scm:
   970:19  5 (tea-loop #<<state> client-request-id: #f 
   agent-request-id: 0 next-session-id: 0 requests-alist: () 
   sessions: ()> "https://llm.example.net" "[MY API KEY]" 
   (("vllm/Qwen/Qwen3.8-27B" . #<<model> name: #f description: #f 
   context-length: #f>) ("vllm/Aleph-Alpha/Kolibri-1" . #<<model> 
   name: #f description: #f context-length: #f>) 
   ("vllm/google/medgemma-27b-it" . #<<model> name: #f 
   description: #f context-length: #f>)) (("read" . #<<tool> 
   descript…>) …) …)
In kaagum/monads.scm:
    139:2  4 (run-with-state _ _)
In kaagum/tea.scm:
   971:20  3 (_ _)
   971:20  2 (_ _)
   205:21  1 (_ _)
In rnrs/records/procedural.scm:
   143:10  0 (_ _)

rnrs/records/procedural.scm:143:10: ERROR:

  1. &assertion-failure

Process acp-client(proxychains4)-36 stderr finished
--8<---------------cut here---------------end--------------->8---

I have installed kaagum 0.1.0 with Guix.

I have no experience with agent-shell, nor do I have access to any 
other LLM server.  Am I doing something obviously wrong?

I've also changed the URL to https://llm.example.net/v1 and it 
fails at a different point:

--8<---------------cut here---------------start------------->8---
[proxychains] config file found: /path/to/proxychains.conf
[proxychains] preloading 
/gnu/store/djhjgy1j0iqd317pmgazv9wng249q0df-proxychains-ng-4.17/lib/libproxychains4.so
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] Strict chain  ...  127.0.0.1:8022  ... 
llm.example.net:443  ...  OK
Backtrace:
In ice-9/boot-9.scm:
  1791:12  7 (with-exception-handler _ _ #:unwind? _ 
  #:unwind-for-type _)
In unknown file:
           6 (apply-smob/0 #<thunk 7fa0ce1193a0>)
In ice-9/boot-9.scm:
    740:2  5 (call-with-prompt _ _ #<procedure 
    default-prompt-handler (k proc)>)
In ice-9/eval.scm:
    619:8  4 (_ #(#(#<directory (guile-user) 7fa0ce11cc80>)))
In kaagum/tea.scm:
  1015:17  3 (run-tea-loop "https://llm.example.net/v1" "[MY API 
  KEY]" "vllm/Qwen/Qwen3.8-27B" (("read" . #<<tool> description: 
  "Read whole text file, or optionally a subset of its 
  lines.\n\nLine numbers start from 1. Output is the raw file 
  contents without line numbers." parameters: (("path" 
  . #<<tool-parameter> type: "string" description: "File path to 
  read" required?: #t>) ("start-line" . #<<tool-parameter> type: 
  "integer" description: "Read file start…>) …))
In kaagum/openai.scm:
    67:29  2 (openai-models _ _)
In json/parser.scm:
   404:20  1 (json->scm _ #:null _ #:ordered _ #:concatenated _)
     40:2  0 (json-read-number #<input:delimited input port 
     7fa0ce03ed40>)

json/parser.scm:40:2: In procedure json-read-number:
Throw to key json-invalid' with args (#<input:delimited input port 
7fa0ce03ed40>)'.

Process acp-client(proxychains4)-39 stderr finished
--8<---------------cut here---------------end--------------->8---

In the Bifrost admin interface I see that my "hello" message has 
been processed, but the response never made it to Emacs.

-- 
Ricardo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: connecting to bifrost over SOCKS5 proxy fails
  2026-11-02 19:54 connecting to bifrost over SOCKS5 proxy fails Ricardo Wurmus
@ 2026-11-03  0:43 ` Arun Isaac
  2026-11-03 12:45   ` Ricardo Wurmus
  0 siblings, 1 reply; 3+ messages in thread
From: Arun Isaac @ 2026-11-03  0:43 UTC (permalink / raw)
  To: Ricardo Wurmus, kaagum


Hi Ricardo,

Thanks for trying kaagum out!

It's possible there is a bug in kaagum. I have only tested it with
OpenRouter. I don't see anything obviously wrong with your
configuration. But I'll look at your report more closely tomorrow and
get back to you.

Meanwhile, you could also try adding "--trace-file=/tmp/kaagum-trace" to
agent-shall-kaagum-parameters. That should produce a detailed trace in
/tmp/kaagum-trace. Maybe that will help narrow down the problem.

Regards,
Arun

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: connecting to bifrost over SOCKS5 proxy fails
  2026-11-03  0:43 ` Arun Isaac
@ 2026-11-03 12:45   ` Ricardo Wurmus
  0 siblings, 0 replies; 3+ messages in thread
From: Ricardo Wurmus @ 2026-11-03 12:45 UTC (permalink / raw)
  To: Arun Isaac; +Cc: Ricardo Wurmus, kaagum

Hi Arun,

> It's possible there is a bug in kaagum. I have only tested it 
> with
> OpenRouter. I don't see anything obviously wrong with your
> configuration. But I'll look at your report more closely 
> tomorrow and
> get back to you.
>
> Meanwhile, you could also try adding 
> "--trace-file=/tmp/kaagum-trace" to
> agent-shall-kaagum-parameters. That should produce a detailed 
> trace in
> /tmp/kaagum-trace. Maybe that will help narrow down the problem.

I have upgraded to the latest commit of kaagum to get the 
trace-file feature (v0.1.0 does not seem to have it) and tried 
again.

Now I get a different (and later) error:

--8<---------------cut here---------------start------------->8---
[proxychains] Strict chain  ...  127.0.0.1:8022  ... 
llm.example.net:443  ...  OK
WARNING: (kaagum web): imported module (rnrs conditions) overrides 
core binding `&error'
Backtrace:
In ice-9/boot-9.scm:
  1791:12 17 (with-exception-handler _ _ #:unwind? _ 
  #:unwind-for-type _)
In unknown file:
          16 (apply-smob/0 #<thunk 7fbc9fc8f3a0>)
In ice-9/boot-9.scm:
    740:2 15 (call-with-prompt _ _ #<procedure 
    default-prompt-handler (k proc)>)
In ice-9/eval.scm:
    619:8 14 (_ #(#(#<directory (guile-user) 7fbc9fc92c80>)))
In ice-9/boot-9.scm:
    161:2 13 (with-fluid* _ _ _)
In ice-9/ports.scm:
   439:17 12 (call-with-output-file _ _ #:binary _ #:encoding _)
In ice-9/boot-9.scm:
    161:2 11 (with-fluid* _ _ _)
In kaagum/tea.scm:
   979:19 10 (tea-loop #<<state> client-request-id: 4 
   agent-request-id: 0 next-session-id: 1 requests-alist: () 
   sessions: (("session-0" . #<<session> cwd: "/path/to/my/dir" 
   model: "vllm/Qwen/Qwen3.8-27B" input-tokens: 0 output-tokens: 0 
   thought-tokens: 0 cache-read-tokens: 0 cache-write-tokens: 0 
   cost: 0 cancelling?: #f messages: ((("role" . "user") 
   ("content" . #((("text" . "hello") ("type" . "text")))))) 
   tool-calls: () allowed-tools: () rejected-tools: ()>))> 
   "https://llm…" …)
In kaagum/monads.scm:
    139:2  9 (run-with-state _ _)
In kaagum/tea.scm:
   980:20  8 (_ _)
   980:20  7 (_ _)
   829:26  6 (_ _)
In kaagum/utils.scm:
    33:22  5 (->-helper #<<state> client-request-id: 4 
    agent-request-id: 0 next-session-id: 1 requests-alist: () 
    sessions: (("session-0" . #<<session> cwd: "/path/to/my/dir" 
    model: "vllm/Qwen/Qwen3.8-27B" input-tokens: 956 
    output-tokens: 35 thought-tokens: 23 cache-read-tokens: 0 
    cache-write-tokens: 0 cost: 0 cancelling?: #f messages: 
    ((("role" . "user") ("content" . #((("text" . "hello") ("type" 
    . "text")))))) tool-calls: () allowed-tools: () 
    rejected-tools: ()>))> #<proce…> …)
In kaagum/records.scm:
    61:48  4 (_ #<<state> client-request-id: 4 agent-request-id: 0 
    next-session-id: 1 requests-alist: () sessions: (("session-0" 
    . #<<session> cwd: "/path/to/my/dir" model: 
    "vllm/Qwen/Qwen3.8-27B" input-tokens: 956 output-tokens: 35 
    thought-tokens: 23 cache-read-tokens: 0 cache-write-tokens: 0 
    cost: 0 cancelling?: #f messages: ((("role" . "user") 
    ("content" . #((("text" . "hello") ("type" . "text")))))) 
    tool-calls: () allowed-tools: () rejected-tools: ()>))> 
    #<procedure 7fbc…>)
In srfi/srfi-1.scm:
   702:17  3 (map1 (("session-0" . #<<session> cwd: 
   "/path/to/my/dir" model: "vllm/Qwen/Qwen3.8-27B" input-tokens: 
   956 output-tokens: 35 thought-tokens: 23 cache-read-tokens: 0 
   cache-write-tokens: 0 cost: 0 cancelling?: #f messages: 
   ((("role" . "user") ("content" . #((("text" . "hello") ("type" 
   . "text")))))) tool-calls: () allowed-tools: () rejected-tools: 
   ()>)))
In lens/lenses.scm:
    95:54  2 (_ _)
In kaagum/records.scm:
    61:48  1 (_ #<<session> cwd: "/path/to/my/dir" model: 
    "vllm/Qwen/Qwen3.8-27B" input-tokens: 956 output-tokens: 35 
    thought-tokens: 23 cache-read-tokens: 0 cache-write-tokens: 0 
    cost: 0 cancelling?: #f messages: ((("role" . "user") 
    ("content" . #((("text" . "hello") ("type" . "text")))))) 
    tool-calls: () allowed-tools: () rejected-tools: ()> 
    #<procedure 7fbc9fccd420 at kaagum/lens.scm:57:13 
    (t-715eab49ae64536-24)>)
In kaagum/lens.scm:
    57:13  0 (_ 0)

kaagum/lens.scm:57:13: In procedure +: Wrong type argument in 
position 1: #f

Process acp-client(proxychains4)-48 stderr finished
--8<---------------cut here---------------end--------------->8---

I ran "/tools" (which worked) and "hello", which produced the 
error.

The trace says this:


--8<---------------cut here---------------start------------->8---
web: -> GET https://llm.example.net/v1/models
web: <- 200 
{"key_statuses":[{"provider":"vllm","status":"success","key_id":"..."},{"provider":"vllm","status":"success","key_id":"..."},{"provider":"vllm","status":"success","key_id":"..."},{"provider":"vllm","status":"success","key_id":"..."},{"provider":"vllm","status":"success","key_id":"..."},{"provider":"vllm","status":"success","key_id":"..."},{"provider":"vllm","status":"success","key_id":"..."},{"provider":"vllm","status":"success","key_id":"..."},{"provider":"vllm","status":"success","key_id":"..."}],"extra_fields":{"chunk_index":0,"latency":38,"routing_info":{},"request_type":"list_models"},"data":[{"owned_by":"vllm","created":1793709325,"id":"vllm/Aleph-Alpha/Kolibri-1"},{"owned_by":"vllm","created":1793709325,"id":"vllm/Qwen/Qwen3.8-27B"},{"owned_by":"vllm","created":1793709325,"id":"vllm/google/medgemma-27b-it"}]}
acp: <- 
{"jsonrpc":"2.0","method":"initialize","id":1,"params":{"clientInfo":{"name":"agent-shell","title":"Emacs 
Agent 
Shell","version":"0.89.1"},"protocolVersion":1,"clientCapabilities":{"fs":{"readTextFile":true,"writeTextFile":true}}}}
acp: -> 
{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":1,"agentCapabilities":{},"agentInfo":{"name":"kaagum","title":"Kaagum","version":"0.1.0"},"authMethods":[]}}
acp: <- 
{"jsonrpc":"2.0","method":"session/new","id":2,"params":{"cwd":"/path/to/my/cwd","mcpServers":[]}}
acp: -> 
{"jsonrpc":"2.0","id":2,"result":{"sessionId":"session-0","configOptions":[{"id":"model","name":"Model","category":"model","type":"select","currentValue":"vllm/Qwen/Qwen3.8-27B","options":[{"value":"vllm/Qwen/Qwen3.8-27B"},{"value":"vllm/Aleph-Alpha/Kolibri-1"},{"value":"vllm/google/medgemma-27b-it"}]}]}}
acp: -> 
{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"session-0","update":{"sessionUpdate":"available_commands_update","availableCommands":[{"name":"cwd","description":"Print 
current working directory of the 
session"},{"name":"tools","description":"List available tools and 
their permission status"}]}}}
acp: <- 
{"jsonrpc":"2.0","method":"session/prompt","id":3,"params":{"sessionId":"session-0","prompt":[{"type":"text","text":"/tools"}]}}
acp: -> 
{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"session-0","update":{"sessionUpdate":"agent_message_chunk","content":{"type":"text","text":"| 
Tool | Permission |\n| --- | --- |\n| read | prompt user |\n| list 
| prompt user |\n| search | prompt user |\n| github-issue | prompt 
user |"}}}}
acp: -> 
{"jsonrpc":"2.0","id":3,"result":{"stopReason":"end_turn"}}
acp: -> 
{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"session-0","update":{"sessionUpdate":"usage_update","used":0,"size":false,"cost":{"amount":0,"currency":"USD"}}}}
acp: <- 
{"jsonrpc":"2.0","method":"session/prompt","id":4,"params":{"sessionId":"session-0","prompt":[{"type":"text","text":"hello"}]}}
web: -> POST https://llm.example.net/v1/chat/completions 
{"model":"vllm/Qwen/Qwen3.8-27B","cache_control":{"type":"ephemeral","ttl":"1h"},"messages":[{"role":"user","content":[{"text":"hello","type":"text"}]}],"tools":[{"type":"function","function":{"name":"read","description":"Read 
whole text file, or optionally a subset of its lines.\n\nLine 
numbers start from 1. Output is the raw file contents without line 
numbers.","parameters":{"type":"object","properties":{"path":{"description":"File 
path to read","type":"string"},"start-line":{"description":"Read 
file starting from this line number (inclusive). Default is 
1.","type":"integer"},"end-line":{"description":"Read up to this 
line number (inclusive). Default is the last line of the 
file.","type":"integer"}},"required":["path"]}}},{"type":"function","function":{"name":"list","description":"List 
files recursively.\n\nThe output is in three columns—the file 
type, the file size and the file 
path.","parameters":{"type":"object","properties":{"root":{"description":"Root 
path to list 
from","type":"string"},"pattern":{"description":"POSIX extended 
regular expression to match basename (including extension) 
of\nfile against. Default matches all files.\n\nFor example, to 
match all scheme (.scm) files, use 
\"\\.scm$\"","type":"string"}},"required":["root"]}}},{"type":"function","function":{"name":"search","description":"Print 
lines that match a pattern (similar to grep)\n\nSimilar to grep, 
the output is three colon separated columns—the file path, 
the\nline number and the matching line. Line numbers start from 
1.","parameters":{"type":"object","properties":{"pattern":{"description":"POSIX 
extended regular expression to search 
for","type":"string"},"files-root":{"description":"Root path to 
start search 
from","type":"string"},"files-pattern":{"description":"POSIX 
extended regular expression to match basename (including 
extension) of\nfile against. Default matches all files.\n\nFor 
example, to match all scheme (.scm) files, use 
\"\\.scm$\"","type":"string"}},"required":["pattern","files-root"]}}},{"type":"function","function":{"name":"github-issue","description":"Read 
conversation in GitHub/Forgejo issue.\n\nFor example, to read 
https://codeberg.org/guix/maintenance/issues/105, use 
the\nfollowing arguments:\n{\n  \"host\": \"codeberg.org\",\n 
\"owner\": \"guix\",\n  \"repo\": \"maintenance\",\n 
\"issue-number\": 
105\n}\n","parameters":{"type":"object","properties":{"host":{"description":"Host 
(aka domain name) of GitHub/Forgejo instance. Default is 
\"github.com\".","type":"string"},"owner":{"description":"Owner 
(or organization) from the issue 
URL","type":"string"},"repo":{"description":"Repository name from 
the issue URL","type":"string"},"number":{"description":"Issue 
number to 
read","type":"integer"}},"required":["owner","repo","number"]}}}]}
web: <- 200 
{"extra_fields":{"chunk_index":0,"upstream_latency":346,"latency":346,"resolved_model_used":"Qwen/Qwen3.8-27B","original_model_requested":"Qwen/Qwen3.8-27B","provider":"vllm","routing_info":{"key":"GPU1","model":"Qwen/Qwen3.8-27B","provider":"vllm"},"request_type":"chat_completion"},"usage":{"total_tokens":991,"completion_tokens_details":{"reasoning_tokens":23},"completion_tokens":35,"prompt_tokens":956},"system_fingerprint":"vllm-0.29.0-17dae9e8","object":"chat.completion","model":"Qwen/Qwen3.8-27B","created":1793709349,"choices":[{"message":{"reasoning_content":"The 
user just said \"hello\" — a simple greeting. I should respond in 
a friendly and helpful 
manner.\n","reasoning_details":[{"text":"The user just said 
\"hello\" — a simple greeting. I should respond in a friendly and 
helpful 
manner.\n","type":"reasoning.text","index":0}],"reasoning":"The 
user just said \"hello\" — a simple greeting. I should respond in 
a friendly and helpful 
manner.\n","refusal":null,"content":"\n\nHello! How can I help you 
today?","role":"assistant"},"logprobs":null,"finish_reason":"stop","index":0}],"id":"chatcmpl-8dfb5f093fb5db67"}
--8<---------------cut here---------------end--------------->8---

-- 
Ricardo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-03 12:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-02 19:54 connecting to bifrost over SOCKS5 proxy fails Ricardo Wurmus
2026-11-03  0:43 ` Arun Isaac
2026-11-03 12:45   ` Ricardo Wurmus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox