Convert gitgram/ and aitimemachine/ from embedded git repos (which showed as opaque submodule gitlinks on GitHub) into fully-tracked first-party content. AITM now merges its 7 vendored repos as first-party engines: - memory: beads (Go task DAG) + context7 (docs SDK), unified into saved_contexts - git: vendored C git (bundled binary) + gitnexus (in-process code intelligence) - agentic: a2a (@a2a-js/sdk) + pal (AITM-managed Python subprocess) Includes the full session's product build: Gitgram web/mobile/backend features, AITM website/CLI/MCP, the unified memory layer, engine build tooling (scripts/build-engines.sh, Dockerfile, CI), docs (README, ENGINES.md, ARCHITECTURE.md), and extensive test suites. Build artifacts, node_modules, external/, and gemini-cli are gitignored. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
83 lines
2.6 KiB
Python
83 lines
2.6 KiB
Python
import json
|
|
import os
|
|
import shutil
|
|
|
|
import pytest
|
|
|
|
from tools.clink import CLinkTool
|
|
|
|
|
|
@pytest.mark.integration
|
|
@pytest.mark.asyncio
|
|
async def test_clink_gemini_single_digit_sum():
|
|
if shutil.which("gemini") is None:
|
|
pytest.skip("gemini CLI is not installed or on PATH")
|
|
|
|
if not (os.getenv("GEMINI_API_KEY") or os.getenv("GOOGLE_API_KEY")):
|
|
pytest.skip("Gemini API key is not configured")
|
|
|
|
tool = CLinkTool()
|
|
prompt = "Respond with a single digit equal to the sum of 2 + 2. Output only that digit."
|
|
|
|
results = await tool.execute(
|
|
{
|
|
"prompt": prompt,
|
|
"cli_name": "gemini",
|
|
"role": "default",
|
|
"absolute_file_paths": [],
|
|
"images": [],
|
|
}
|
|
)
|
|
|
|
assert results, "clink tool returned no outputs"
|
|
payload = json.loads(results[0].text)
|
|
status = payload["status"]
|
|
assert status in {"success", "continuation_available"}
|
|
|
|
content = payload.get("content", "").strip()
|
|
# CLI may include additional metadata like <SUMMARY> tags; check first line or that "4" is present
|
|
first_line = content.split("\n")[0].strip()
|
|
assert first_line == "4" or "4" in content, f"Expected '4' in response, got: {content[:100]}"
|
|
|
|
if status == "continuation_available":
|
|
offer = payload.get("continuation_offer") or {}
|
|
assert offer.get("continuation_id"), "Expected continuation metadata when status indicates availability"
|
|
|
|
|
|
@pytest.mark.integration
|
|
@pytest.mark.asyncio
|
|
async def test_clink_claude_single_digit_sum():
|
|
if shutil.which("claude") is None:
|
|
pytest.skip("claude CLI is not installed or on PATH")
|
|
|
|
tool = CLinkTool()
|
|
prompt = "Respond with a single digit equal to the sum of 2 + 2. Output only that digit."
|
|
|
|
results = await tool.execute(
|
|
{
|
|
"prompt": prompt,
|
|
"cli_name": "claude",
|
|
"role": "default",
|
|
"absolute_file_paths": [],
|
|
"images": [],
|
|
}
|
|
)
|
|
|
|
assert results, "clink tool returned no outputs"
|
|
payload = json.loads(results[0].text)
|
|
status = payload["status"]
|
|
|
|
if status == "error":
|
|
metadata = payload.get("metadata") or {}
|
|
reason = payload.get("content") or metadata.get("message") or "Claude CLI reported an error"
|
|
pytest.skip(f"Skipping Claude integration test: {reason}")
|
|
|
|
assert status in {"success", "continuation_available"}
|
|
|
|
content = payload.get("content", "").strip()
|
|
assert content == "4"
|
|
|
|
if status == "continuation_available":
|
|
offer = payload.get("continuation_offer") or {}
|
|
assert offer.get("continuation_id"), "Expected continuation metadata when status indicates availability"
|