Skip to content

[codex] Update skills for Tool API v3#5

Draft
rodion-m wants to merge 3 commits into
mainfrom
codex/tool-api-v3-skills
Draft

[codex] Update skills for Tool API v3#5
rodion-m wants to merge 3 commits into
mainfrom
codex/tool-api-v3-skills

Conversation

@rodion-m

@rodion-m rodion-m commented Jul 1, 2026

Copy link
Copy Markdown
Member

Summary

  • Updates CodeAlive skill scripts to call Tool API v3 /api/tools/{name} endpoints.
  • Defaults CLI output to agentic format where appropriate and adds repository/artifact query commands.
  • Refreshes README/SKILL guidance for the v3 tool contract.

Cross-repo rollout

  • Depends on backend Tool API v3 PR and aligns with codealive-mcp v3 tool names.
  • Companion documentation PR publishes the updated setup instructions.

Verification

  • Full skills test suite: 13 passed.
  • Targeted checks: pytest tests/test_tool_api_v3.py tests/test_fetch_format.py: 13 passed.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines 757 to 758
result = client.get_datasources(ready_only=ready_only, query=query)
print(json.dumps(result, indent=2))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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))

Comment on lines +238 to 240
if len(identifiers) > 50:
print("Error: Maximum 50 identifiers per request.", file=sys.stderr)
sys.exit(1)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The maximum identifiers limit has been increased to 50 in the code, but the docstring of fetch.py (line 30) and SKILL.md (line 231) still document the limit as 20. Please update the documentation in both places to match the new limit of 50 to avoid confusing users and AI agents.

Comment on lines 250 to +251
result = client.fetch_artifacts(identifiers=identifiers, data_source=data_source)

print(format_artifacts(result, data_source=data_source, requested=identifiers))
print(result)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Comment on lines +32 to +35
elif arg == "--start-line":
start_line = int(value)
else:
end_line = int(value)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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)

Comment on lines +35 to +40
elif arg == "--max-depth":
max_depth = int(value)
elif arg == "--max-nodes":
max_nodes = int(value)
else:
output_depth = int(value)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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)

@rodion-m

rodion-m commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

Self-review pass completed.

Finding addressed before reviewer wait:

  • The context explorer agent guidance still used codebase_consultant as an example trigger. I replaced it with canonical chat wording and pushed 85522fb.

Rechecked:

  • No legacy alias strings remain in the repository.
  • uv run pytest -q: 13 passed.
  • Left unrelated untracked FRESHNESS_DESIGN.md out of the PR.

@rodion-m

rodion-m commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

Review follow-up pushed in 52e35d3.

Addressed Gemini findings:

  • datasources CLI now requests output_format="json" before JSON-printing.
  • Updated fetch identifier limit docs from 20 to 50.
  • Removed obsolete fetch formatter dead code and its obsolete formatter tests.
  • Added graceful integer parsing errors for read_file.py and tree.py numeric options.
  • API client now sends relationship profiles as canonical snake_case values.

Rechecked: uv run pytest -q: 7 passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant