Skip to content

Commit d1675e4

Browse files
hyperpolymathclaude
andcommitted
fix: mount all cartridges on HTTP serve startup
The REST/gRPC/GraphQL serve mode registered all 18 cartridges but never called boj_catalogue_mount(), so every cartridge_info request returned "not mounted". The MCP stdio mode (--mcp) had the mount loop but the HTTP path did not. Also adds missing feedback-mcp library path to the build-adapter linker flags. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9b9fd43 commit d1675e4

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

Justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ build-adapter: build
450450
#!/usr/bin/env bash
451451
set -euo pipefail
452452
echo "Building V-lang adapter..."
453-
v -cc gcc -cflags "-L$(pwd)/ffi/zig/zig-out/lib -L$(pwd)/cartridges/container-mcp/ffi/zig-out/lib -Wl,--allow-multiple-definition" \
453+
v -cc gcc -cflags "-L$(pwd)/ffi/zig/zig-out/lib -L$(pwd)/cartridges/container-mcp/ffi/zig-out/lib -L$(pwd)/cartridges/feedback-mcp/ffi/zig-out/lib -Wl,--allow-multiple-definition" \
454454
-o adapter/v/boj-server adapter/v/src/main.v
455455
echo "Built: adapter/v/boj-server ($(du -h adapter/v/boj-server | cut -f1))"
456456

adapter/v/src/main.v

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,10 @@ mut:
315315
start_time time.Time
316316
node_id string
317317
region string
318+
hostname string
319+
rest_port string
320+
grpc_port string
321+
graphql_port string
318322
event_queue EventQueue
319323
}
320324

@@ -324,6 +328,10 @@ fn BojApp.new() BojApp {
324328
start_time: time.now()
325329
node_id: os.getenv_opt('BOJ_NODE_ID') or { 'local-0' }
326330
region: os.getenv_opt('BOJ_REGION') or { 'local' }
331+
hostname: os.getenv_opt('BOJ_HOSTNAME') or { 'localhost' }
332+
rest_port: os.getenv_opt('BOJ_REST_PORT') or { '7700' }
333+
grpc_port: os.getenv_opt('BOJ_GRPC_PORT') or { '7701' }
334+
graphql_port: os.getenv_opt('BOJ_GRAPHQL_PORT') or { '7702' }
327335
event_queue: EventQueue.new()
328336
}
329337
}
@@ -3130,6 +3138,16 @@ fn main() {
31303138
total := C.boj_catalogue_count()
31313139
ready := C.boj_catalogue_count_ready()
31323140
println('Catalogue: ${total} cartridges registered, ${ready} ready')
3141+
3142+
// Mount all ready cartridges so they can serve requests
3143+
mut mounted_count := usize(0)
3144+
for i in 0 .. int(total) {
3145+
result := C.boj_catalogue_mount(usize(i))
3146+
if result == 0 {
3147+
mounted_count++
3148+
}
3149+
}
3150+
println('Mounted: ${mounted_count}/${total} cartridges')
31333151
println('')
31343152

31353153
app_ref := &app

0 commit comments

Comments
 (0)