OSIS native SDK URL pattern incompatible with per-domain servers (always 404) #10
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_agent#10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
hero_osis_sdk(viahero_rpc_client::OsisClient::new, native build) hardcodes its endpoint URL asformat!("{}/rpc/{}", base_url, context)and only exposes that single constructor.The current per-domain OSIS servers (
hero_osis_ai/rpc.sock,hero_osis_base/rpc.sock, ...) only exposePOST /rpc(no/{context}segment — each socket is already context-scoped). So every native SDK call lands on a 404.This blocks
hero_agentfrom persisting or listing conversations, audit entries, memories, messages, and usage stats — everyOsisStore::*call that goes throughAiClientfails.Discovered while fixing #6 — the original bug (sidebar list shape +
+button context switch) is fully fixed inhero_agent, but end-to-end verification shows the conversation never persists because the SDK calls 404.Repro
The SDK only ever generates the second URL.
Affected code
hero_rpc_client::OsisClient::new(native), incrates/openrpc_http_client_lib/src/lib.rsofhero_rpcdevelopment:The WASM build already worked around an analogous router-rewrite issue by using
/osis-rpc/{context}instead — see the comment at line 188.Proposed fix options
POST /rpc/:contextthat dispatches identically toPOST /rpc(ignoring the context segment, since per-domain sockets are already single-context). One-line route alias inhero_rpc_osis. SDK keeps working as-is./{context}for native transport (URL becomes just{base_url}/rpc); WASM unchanged. Requires every SDK consumer'sOSIS_URLto point at a domain-scoped base (e.g.http://router/hero_osis_ai) —hero_agentalready needs that change.Option 1 is the smallest change with the broadest compatibility.
Affected consumers
Anything using the native
OsisClientagainst a per-domain server. Confirmed:hero_agent. Likely: any other native CLI or daemon talking to a per-domain OSIS server.Acceptance
OsisClient::rpc_callsucceeds when pointed at any per-domain OSIS server (not 404).hero_agent+button creates a conversation that appears in the sidebar (verifying end-to-end).Resolved — already fixed upstream
After investigating further, the SDK URL pattern was already updated in hero_rpc
development(commit38a0929):This generates URLs like
http://127.0.0.1:9988/hero_osis_ai/rpc— which the per-domain server happily accepts at/rpcand which hero_router proxies cleanly tohero_osis_ai/rpc.sock.The reason
hero_agentwas hitting the broken path was that itsCargo.lockwas pinned to an olderhero_rpccommit (91c30ef) that still hadformat!("{}/rpc/{}", base_url, context). Bumping the lock to38a0929resolves the issue.hero_agentalso neededOSIS_URLto point at the router root (http://127.0.0.1:9988) instead of/hero_osis/ui, so the SDK can append/hero_osis_<domain>/rpcitself.Verified end-to-end:
POST /api/conversationsreturns a real ID and the conversation appears in subsequentGET /api/conversations.Closing as fixed.