[codex] Update skills for Tool API v3#5
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the CodeAlive context engine skill to version 3.0.0, transitioning to the stateless Tool API v3. It introduces several new scripts (metadata.py, ontology.py, read_file.py, schema.py, tree.py) and refactors existing scripts and the shared api_client.py to route requests through the new tool method, defaulting to backend-rendered agentic output. The review feedback identifies a serialization bug in the api_client.py CLI, outdated documentation regarding identifier limits in fetch.py, dead code in fetch.py that can be cleaned up, and a lack of exception handling for integer parsing in read_file.py and tree.py.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| result = client.get_datasources(ready_only=ready_only, query=query) | ||
| print(json.dumps(result, indent=2)) |
There was a problem hiding this comment.
The datasources command in the main() CLI of api_client.py calls client.get_datasources without specifying output_format="json". By default, get_datasources uses "agentic" format and returns a pre-rendered string. Attempting to serialize this string with json.dumps(result, indent=2) results in double-serialized JSON string output (with escaped newlines and literal quotes) instead of the actual JSON object.\n\nTo fix this, pass output_format="json" to client.get_datasources so that it returns the parsed dictionary.
result = client.get_datasources(ready_only=ready_only, query=query, output_format="json")\n print(json.dumps(result, indent=2))| if len(identifiers) > 50: | ||
| print("Error: Maximum 50 identifiers per request.", file=sys.stderr) | ||
| sys.exit(1) |
There was a problem hiding this comment.
| result = client.fetch_artifacts(identifiers=identifiers, data_source=data_source) | ||
|
|
||
| print(format_artifacts(result, data_source=data_source, requested=identifiers)) | ||
| print(result) |
There was a problem hiding this comment.
Since fetch.py now prints the backend-rendered result directly, the format_artifacts function and its helper functions (_add_line_numbers, _has_any_calls, _format_relationships_preview, _data_source_miss_hint, _not_found_lines) are now completely unused dead code.\n\nPlease remove these unused functions from the file to improve maintainability and readability.
| elif arg == "--start-line": | ||
| start_line = int(value) | ||
| else: | ||
| end_line = int(value) |
There was a problem hiding this comment.
The command-line arguments --start-line and --end-line are parsed using int(value) directly without handling potential ValueError exceptions. If a user passes a non-integer value, the script will crash with a traceback.\n\nIt is recommended to handle this gracefully with a try-except block, similar to how --max-count is handled in relationships.py.
elif arg == "--start-line":\n try:\n start_line = int(value)\n except ValueError:\n print(f"Error: --start-line expects an integer, got '{value}'", file=sys.stderr)\n sys.exit(1)\n else:\n try:\n end_line = int(value)\n except ValueError:\n print(f"Error: --end-line expects an integer, got '{value}'", file=sys.stderr)\n sys.exit(1)| elif arg == "--max-depth": | ||
| max_depth = int(value) | ||
| elif arg == "--max-nodes": | ||
| max_nodes = int(value) | ||
| else: | ||
| output_depth = int(value) |
There was a problem hiding this comment.
The arguments --max-depth, --max-nodes, and --output-depth are parsed using int(value) directly without handling potential ValueError exceptions. If a user passes a non-integer value, the script will crash with a traceback.\n\nPlease wrap these conversions in try-except blocks to handle invalid inputs gracefully.
elif arg == "--max-depth":\n try:\n max_depth = int(value)\n except ValueError:\n print(f"Error: --max-depth expects an integer, got '{value}'", file=sys.stderr)\n sys.exit(1)\n elif arg == "--max-nodes":\n try:\n max_nodes = int(value)\n except ValueError:\n print(f"Error: --max-nodes expects an integer, got '{value}'", file=sys.stderr)\n sys.exit(1)\n else:\n try:\n output_depth = int(value)\n except ValueError:\n print(f"Error: --output-depth expects an integer, got '{value}'", file=sys.stderr)\n sys.exit(1)|
Self-review pass completed. Finding addressed before reviewer wait:
Rechecked:
|
|
Review follow-up pushed in Addressed Gemini findings:
Rechecked: |
Summary
/api/tools/{name}endpoints.Cross-repo rollout
codealive-mcpv3 tool names.Verification
pytest tests/test_tool_api_v3.py tests/test_fetch_format.py: 13 passed.