fix: tool registry emits Anthropic schema, question lifecycle cleanup

- Tool.to_schema() emits input_schema (Anthropic Messages API) instead
  of OpenAI-style parameters
- QuestionManager: remove questions from _pending on answer and timeout,
  reject double answers, add list_pending()
- core/skills/__init__.py so skills are importable as a package
- revert optional-import fallbacks in logger/message_bus: nats-py and
  loguru are hard requirements, a broken install should fail loudly
- tests for wait_for_answer happy path and timeout cleanup

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012AJLYcbTHCe45fyFnMfEin
This commit is contained in:
2026-09-22 15:52:06 +05:30
parent be8103c1d2
commit 58bfa07385
6 changed files with 64 additions and 40 deletions

View File

@@ -33,7 +33,7 @@ class Tool:
metadata: Dict[str, Any] = field(default_factory=dict)
def to_schema(self) -> Dict[str, Any]:
"""Generate OpenAI/Claude compatible JSON Schema for tool calling."""
"""Generate an Anthropic Messages API tool definition (name / description / input_schema)."""
properties = {}
required = []
@@ -56,7 +56,7 @@ class Tool:
return {
"name": self.name,
"description": self.description,
"parameters": {
"input_schema": {
"type": "object",
"properties": properties,
"required": required,