check server.py implements all methods of openrpc #1
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_claude#1
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?
/Volumes/T7/code0/claude_server/crates/hero_claude_server/server.py
does it fully implement
/Volumes/T7/code0/claude_server/crates/hero_claude_server/openrpc.json
is it registered on right socket? ~/hero/var/sockets/hero_claude_server.sock
as UDS see skill /hero_sockets
make sure we have good tests in
/Volumes/T7/code0/claude_server/crates/hero_claude_examples/tests/integration.rs
use make run to start the server
Implementation Spec for Issue #1 — ACP Server OpenRPC Compliance & Integration Tests
Objective
Verify and close all gaps between
openrpc.json(the authoritative ACP spec),server.py(the Python implementation), andintegration.rs(the Rust integration test suite). Fix the confirmed socket-path discrepancy in the spec, add integration-test coverage for every missing OpenRPC method group, and confirmmake runcorrectly starts the server on the required UDS.Findings Summary
rpc.*) are fully implemented — no gaps.servers[0].url: Usesunix:///hero/var/sockets/hero_claude_server.sock(absolute path) — should beunix://~/hero/var/sockets/hero_claude_server.sock(home-relative, per hero_sockets standard). server.py is correct; the spec doc is wrong.pong.service == "acp"but server returns"hero_claude_server"— test will fail.integration.rs(agent update/start/stop/restart/heartbeat/state/capabilities, task cancel/retry/messages/input/steps/logs, all 4 event methods).make test-integrationcombined target exists.Requirements
openrpc.jsonservers[0].urltounix://~/hero/var/sockets/hero_claude_server.socktest_pingassertion:pong.serviceshould equal"hero_claude_server"not"acp"test_agent_extendedcovering:acp.agent.update,acp.agent.start,acp.agent.stop,acp.agent.restart,acp.agent.heartbeat,acp.agent.state,acp.agent.capabilitiestest_task_extendedcovering:acp.task.cancel,acp.task.retry,acp.task.messages,acp.task.input,acp.task.steps,acp.task.logstest_event_lifecyclecovering:acp.event.subscribe,acp.event.poll,acp.event.list,acp.event.unsubscribemake test-integrationMakefile targetFiles to Modify
crates/hero_claude_server/openrpc.jsonservers[0].urlsocket pathcrates/hero_claude_examples/tests/integration.rsMakefiletest-integrationtargetImplementation Plan
Step 1 — Fix openrpc.json socket URL
File:
crates/hero_claude_server/openrpc.jsonChange
unix:///hero/var/sockets/hero_claude_server.sock→unix://~/hero/var/sockets/hero_claude_server.sockDependencies: None
Step 2 — Fix test_ping service-name assertion
File:
crates/hero_claude_examples/tests/integration.rsChange
assert_eq!(pong.service, "acp", ...)→assert_eq!(pong.service, "hero_claude_server", ...)Dependencies: None (independent of Step 1)
Step 3 — Add test_agent_extended
File:
crates/hero_claude_examples/tests/integration.rsNew
#[tokio::test]covering agent update/heartbeat/state/capabilities/start/restart/stop sequence.Dependencies: Step 2 (same file)
Step 4 — Add test_task_extended
File:
crates/hero_claude_examples/tests/integration.rsNew
#[tokio::test]covering task input/messages/steps/logs/cancel/retry.Dependencies: Steps 2–3 (same file)
Step 5 — Add test_event_lifecycle
File:
crates/hero_claude_examples/tests/integration.rsNew
#[tokio::test]covering event subscribe/poll/list/unsubscribe.Dependencies: Steps 2–4 (same file)
Step 6 — Add make test-integration target
File:
MakefileAdd combined
test-integrationtarget that starts server, runscargo test --test integration, stops server.Dependencies: None (independent of Steps 2–5)
Acceptance Criteria
openrpc.jsonservers[0].urlreadsunix://~/hero/var/sockets/hero_claude_server.socktest_pingpasses against the live server (pong.service == "hero_claude_server")test_agent_extendedcompiles and passes: all 7 agent sub-methods return valid responsestest_task_extendedcompiles and passes: all 6 task sub-methods return valid responsestest_event_lifecyclecompiles and passes: subscribe → poll → unsubscribe round-trip succeedsmake test-integrationstarts server, runs all integration tests, stops serveropenrpc.jsonhas at least one integration test assertion inintegration.rsNotes
openrpc_client!macro fromopenrpc.json— after Step 1, runcargo checkto confirm nothing breaks.test_task_retrylogic must be conditional on task status (server rejects retry on completed tasks).make test-integrationrequireshero_procto be running; tests gracefully skip if not available.Implementation Spec for Issue #1 — ACP Server OpenRPC Compliance & Integration Tests
Objective
Verify and close all gaps between
openrpc.json(the authoritative ACP spec),server.py(the Python implementation), andintegration.rs(the Rust integration test suite). Fix the confirmed socket-path discrepancy in the spec, add integration-test coverage for every missing OpenRPC method group, and confirmmake runcorrectly starts the server on the required UDS.Findings Summary
rpc.*) are fully implemented — no gaps.servers[0].url: Usesunix:///hero/var/sockets/hero_claude_server.sock(absolute path) — should beunix://~/hero/var/sockets/hero_claude_server.sock(home-relative, per hero_sockets standard). server.py is correct; the spec doc is wrong.pong.service == "acp"but server returns"hero_claude_server"— test will fail.integration.rs(agent update/start/stop/restart/heartbeat/state/capabilities, task cancel/retry/messages/input/steps/logs, all 4 event methods).make test-integrationcombined target exists.Requirements
openrpc.jsonservers[0].urltounix://~/hero/var/sockets/hero_claude_server.socktest_pingassertion:pong.serviceshould equal"hero_claude_server"not"acp"test_agent_extendedcovering:acp.agent.update,acp.agent.start,acp.agent.stop,acp.agent.restart,acp.agent.heartbeat,acp.agent.state,acp.agent.capabilitiestest_task_extendedcovering:acp.task.cancel,acp.task.retry,acp.task.messages,acp.task.input,acp.task.steps,acp.task.logstest_event_lifecyclecovering:acp.event.subscribe,acp.event.poll,acp.event.list,acp.event.unsubscribemake test-integrationMakefile targetFiles to Modify
crates/hero_claude_server/openrpc.jsonservers[0].urlsocket pathcrates/hero_claude_examples/tests/integration.rsMakefiletest-integrationtargetImplementation Plan
Step 1 — Fix openrpc.json socket URL
File:
crates/hero_claude_server/openrpc.jsonChange
unix:///hero/var/sockets/hero_claude_server.sock→unix://~/hero/var/sockets/hero_claude_server.sockDependencies: None
Step 2 — Fix test_ping service-name assertion
File:
crates/hero_claude_examples/tests/integration.rsChange
assert_eq!(pong.service, "acp", ...)→assert_eq!(pong.service, "hero_claude_server", ...)Dependencies: None (independent of Step 1)
Step 3 — Add test_agent_extended
File:
crates/hero_claude_examples/tests/integration.rsNew
#[tokio::test]covering agent update/heartbeat/state/capabilities/start/restart/stop sequence.Dependencies: Step 2 (same file)
Step 4 — Add test_task_extended
File:
crates/hero_claude_examples/tests/integration.rsNew
#[tokio::test]covering task input/messages/steps/logs/cancel/retry.Dependencies: Steps 2–3 (same file)
Step 5 — Add test_event_lifecycle
File:
crates/hero_claude_examples/tests/integration.rsNew
#[tokio::test]covering event subscribe/poll/list/unsubscribe.Dependencies: Steps 2–4 (same file)
Step 6 — Add make test-integration target
File:
MakefileAdd combined
test-integrationtarget that starts server, runscargo test --test integration, stops server.Dependencies: None (independent of Steps 2–5)
Acceptance Criteria
openrpc.jsonservers[0].urlreadsunix://~/hero/var/sockets/hero_claude_server.socktest_pingpasses against the live server (pong.service == "hero_claude_server")test_agent_extendedcompiles and passes: all 7 agent sub-methods return valid responsestest_task_extendedcompiles and passes: all 6 task sub-methods return valid responsestest_event_lifecyclecompiles and passes: subscribe → poll → unsubscribe round-trip succeedsmake test-integrationstarts server, runs all integration tests, stops serveropenrpc.jsonhas at least one integration test assertion inintegration.rsNotes
openrpc_client!macro fromopenrpc.json— after Step 1, runcargo checkto confirm nothing breaks.test_task_retrylogic must be conditional on task status (server rejects retry on completed tasks).make test-integrationrequireshero_procto be running; tests gracefully skip if not available.Test Results
Compilation
cargo check --test integrationcompleted successfully in 1.13s with no errors or warnings.Test Run
Passing Tests
test_ping— oktest_agent_lifecycle— oktest_task_lifecycle— okFailing Tests
All 6 failures share the same root cause:
Transport("Request failed: connection closed before message completed")test_health— panicked at line 106:health failed: Transport(...)test_rpc_discover— panicked at line 130:rpc.discover failed: Some(Transport(...))test_agent_extended— panicked at line 226:register failed: Transport(...)test_task_extended— panicked at line 416:task.messages failed: Transport(...)test_event_lifecycle— panicked at line 566:event.poll failed: Transport(...)test_metrics— panicked at line 618:metrics failed: Transport(...)Details
The UDS server is reachable (basic ping, agent lifecycle, and task lifecycle pass), but the connection is being closed prematurely before some method responses complete. The repeated log line
OpenRPC transport: connection error: error shutting down connectionsuggests the server is closing the socket after handling certain requests before the client finishes reading the response. This points to a server-side issue with request handling or connection keep-alive for methods likehealth,rpc.discover,agent.register,task.messages,event.poll, andmetrics.Implementation Complete — Issue #1
Changes Made
crates/hero_claude_server/openrpc.jsonservers[0].urlfromunix:///hero/var/sockets/hero_claude_server.socktounix://~/hero/var/sockets/hero_claude_server.sock(home-relative, per hero_sockets standard)crates/hero_claude_examples/tests/integration.rstest_pingassertion:pong.servicenow asserts"hero_claude_server"(was wrong"acp")test_agent_extended: coversacp.agent.update,acp.agent.heartbeat,acp.agent.state,acp.agent.capabilities,acp.agent.start,acp.agent.restart,acp.agent.stoptest_task_extended: coversacp.task.input,acp.task.messages,acp.task.steps,acp.task.logs,acp.task.cancel,acp.task.retrytest_event_lifecycle: coversacp.event.subscribe,acp.event.poll,acp.event.list,acp.event.unsubscribecrates/hero_claude_server/server.pyConnection: closemiddleware so aiohttp closes the socket cleanly after each request/response cycleMakefiletest-integrationtarget: starts server, runscargo test --test integration, stops server, exits with test exit codeTest Results
test_ping✅test_health✅test_rpc_discover✅test_agent_lifecycle✅test_agent_extended✅ (new)test_task_lifecycle✅test_task_extended✅ (new)test_event_lifecycle✅ (new)test_metrics✅Acceptance Criteria
openrpc.jsonservers[0].urlreadsunix://~/hero/var/sockets/hero_claude_server.socktest_pingpasses (pong.service == "hero_claude_server")test_agent_extendedcovers all 7 agent sub-methodstest_task_extendedcovers all 6 task sub-methodstest_event_lifecyclecovers subscribe → poll → unsubscribe round-tripmake test-integrationtarget addedopenrpc.jsonhas at least one integration test assertionImplementation Complete — Issue #1
Changes Made
crates/hero_claude_server/openrpc.jsonservers[0].urlfromunix:///hero/var/sockets/hero_claude_server.socktounix://~/hero/var/sockets/hero_claude_server.sock(home-relative, per hero_sockets standard)crates/hero_claude_examples/tests/integration.rstest_pingassertion:pong.servicenow asserts"hero_claude_server"(was wrong"acp")test_agent_extended: coversacp.agent.update,acp.agent.heartbeat,acp.agent.state,acp.agent.capabilities,acp.agent.start,acp.agent.restart,acp.agent.stoptest_task_extended: coversacp.task.input,acp.task.messages,acp.task.steps,acp.task.logs,acp.task.cancel,acp.task.retrytest_event_lifecycle: coversacp.event.subscribe,acp.event.poll,acp.event.list,acp.event.unsubscribecrates/hero_claude_server/server.pyConnection: closemiddleware so aiohttp closes the socket cleanly after each request/response cycleMakefiletest-integrationtarget: starts server, runscargo test --test integration, stops server, exits with test exit codeTest Results
test_ping✅test_health✅test_rpc_discover✅test_agent_lifecycle✅test_agent_extended✅ (new)test_task_lifecycle✅test_task_extended✅ (new)test_event_lifecycle✅ (new)test_metrics✅Acceptance Criteria
openrpc.jsonservers[0].urlreadsunix://~/hero/var/sockets/hero_claude_server.socktest_pingpasses (pong.service == "hero_claude_server")test_agent_extendedcovers all 7 agent sub-methodstest_task_extendedcovers all 6 task sub-methodstest_event_lifecyclecovers subscribe → poll → unsubscribe round-tripmake test-integrationtarget addedopenrpc.jsonhas at least one integration test assertion