Runtime error during refactoring with custom provider
- Dominant language
- Go
- Stars
- 17
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
@volodya-lombrozo
I'm running refrax on a large project with a `custom` LLM provider and after about 20 minutes of work I get this error:
```4:42PM INF facilitator: Received 1 suggestions from brain
4:42PM INF facilitator: Received 1 most important suggestions
2025/12/19 16:42:01 http: panic serving 127.0.0.1:43736: Failed to fix class: failed to ask fixer: failed to send message to fixer: failed to send request '{2.0 message/send 0xc001408750 55d083a9-5e93-45d3-9eef-8589402a2c9d}': Post "http://localhost:44497": dial tcp 127.0.0.1:44497: connect: connection refused
goroutine 114 [running]:
net/http.(*conn).serve.func1()
/home/lavrenty/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.linux-amd64/src/net/http/server.go:1947 +0xbe
panic({0x93cb40?, 0xc023c10040?})
/home/lavrenty/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.linux-amd64/src/runtime/panic.go:792 +0x132
github.com/cqfn/refrax/internal/facilitator.(*agent).refactorAll(0xc0002e81e0, {0xc00411e700, 0x1, 0xc0007d7020?}, 0xc8)
/home/lavrenty/repos/refrax/internal/facilitator/agent.go:169 +0xae5
github.com/cqfn/refrax/internal/facilitator.(*agent).Refactor(0xc0002e81e0, 0xc00014e5f0)
/home/lavrenty/repos/refrax/internal/facilitator/agent.go:82 +0x516
github.com/cqfn/refrax/internal/facilitator.(*A2AFacilitator).thinkLong(0xc000294a80, 0x0?)
/home/lavrenty/repos/refrax/internal/facilitator/server.go:99 +0x82
github.com/cqfn/refrax/internal/facilitator.(*A2AFacilitator).think(0xc000294a80, {0xe0d910, 0xc0002ae0a0}, 0xc0003b8480)
/home/lavrenty/repos/refrax/internal/facilitator/server.go:90 +0xa5
github.com/cqfn/refrax/internal/protocol.(*a2aServer).handleJSONRPC.basic.func1(0x7ab83c07cf08?, 0xc0001a2140)
/home/lavrenty/repos/refrax/internal/protocol/a2a_server.go:148 +0x4cb
github.com/cqfn/refrax/internal/client.(*RefraxClient).Refactor.countStats.func8(0xc0003b60e0, 0xc0001a2140)
/home/lavrenty/repos/refrax/internal/client/refrax_client.go:359 +0x6d
github.com/cqfn/refrax/internal/protocol.(*a2aServer).handleJSONRPC(0xc00016cf00, {0xe0c970, 0xc000000000}, 0xc0002ea000)
/home/lavrenty/repos/refrax/internal/protocol/a2a_server.go:117 +0x2cc
github.com/cqfn/refrax/internal/protocol.(*a2aServer).handleRequest(0x28?, {0xe0c970, 0xc000000000}, 0x41a8b4?)
/home/lavrenty/repos/refrax/internal/protocol/a2a_server.go:96 +0x1d
net/http.HandlerFunc.ServeHTTP(0xc0001443c0?, {0xe0c970?, 0xc000000000?}, 0xc000323b60?)
/home/lavrenty/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.linux-amd64/src/net/http/server.go:2294 +0x29
net/http.(*ServeMux).ServeHTTP(0x41b345?, {0xe0c970, 0xc000000000}, 0xc0002ea000)
/home/lavrenty/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.linux-amd64/src/net/http/server.go:2822 +0x1c4
net/http.serverHandler.ServeHTTP({0xe0abf8?}, {0xe0c970?, 0xc000000000?}, 0x1?)
/home/lavrenty/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.linux-amd64/src/net/http/server.go:3301 +0x8e
net/http.(*conn).serve(0xc0001ba090, {0xe0d8d8, 0xc0003a41e0})
/home/lavrenty/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.linux-amd64/src/net/http/server.go:2102 +0x625
created by net/http.(*Server).Serve in goroutine 11
/home/lavrenty/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.linux-amd64/src/net/http/server.go:3454 +0x485
4:42PM INF facilitator: Facilitator server stopped successfully
4:42PM INF critic: Stopping critic server...
4:42PM INF critic: Critic server stopped successfully
```
Statistics output:
```
metric,critic,fixer,facilitator,total
Total LLM messages asked,473,0,0,473
Total LLM request duration,7h13m45.90124892s,0s,0s,7h13m45.90124892s
Total LLM tokens,364899,0,0,364899
Total LLM request tokens,352070,0,0,352070
Total LLM response tokens,12829,0,0,12829
Total LLM bytes,1708616,0,0,1708616
Total LLM request bytes,1644019,0,0,1644019
Total LLM response bytes,64597,0,0,64597
Average LLM request duration,55.023047037s,0s,0s,55.023047037s
Average LLM request tokens,744.3340,0.0000,0.0000,744.3340
Average LLM response tokens,27.1226,0.0000,0.0000,27.1226
Average LLM request bytes,3475.7273,0.0000,0.0000,3475.7273
Average LLM response bytes,136.5687,0.0000,0.0000,136.5687
Total A2A messages asked,473,0,0,473
Total A2A request duration,7h14m54.414575136s,0s,0s,7h14m54.414575136s
Total A2A tokens,1227648,0,0,1227648
Total A2A request tokens,1152397,0,0,1152397
Total A2A response tokens,75251,0,0,75251
Total A2A bytes,2080016,0,0,2080016
Total A2A request bytes,1831976,0,0,1831976
Total A2A response bytes,248040,0,0,248040
Average A2A request duration,55.167895507s,0s,0s,55.167895507s
Average A2A request tokens,2436.3573,0.0000,0.0000,2436.3573
Average A2A response tokens,159.0930,0.0000,0.0000,159.0930
Average A2A request bytes,3873.0994,0.0000,0.0000,3873.0994
Average A2A response bytes,524.3975,0.0000,0.0000,524.3975
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.