|
49 | 49 | # Valid reasoning effort levels per Copilot SDK |
50 | 50 | VALID_REASONING_EFFORTS = frozenset({"low", "medium", "high", "xhigh"}) |
51 | 51 |
|
| 52 | +# ═══════════════════════════════════════════════════════════════════════════════ |
| 53 | +# MODEL CACHE CONFIGURATION |
| 54 | +# ═══════════════════════════════════════════════════════════════════════════════ |
| 55 | +# |
| 56 | +# The model cache persists model metadata (context_window, max_output_tokens) |
| 57 | +# to disk so that provider initialization can return accurate values without |
| 58 | +# calling the SDK API every time. |
| 59 | +# |
| 60 | +# Cache is written by list_models() (called during `amplifier init`) and read |
| 61 | +# during provider initialization (mount/constructor). |
| 62 | +# |
| 63 | +# Cross-platform: Uses pathlib.Path.home() which works on: |
| 64 | +# - Linux: /home/<user>/.amplifier/cache/ |
| 65 | +# - WSL: /home/<user>/.amplifier/cache/ |
| 66 | +# - macOS: /Users/<user>/.amplifier/cache/ |
| 67 | +# - Windows: C:\Users\<user>\.amplifier\cache\ |
| 68 | + |
| 69 | +CACHE_FORMAT_VERSION = 1 # Increment on breaking schema changes |
| 70 | +CACHE_FILE_NAME = "github-copilot-models.json" # Provider-specific file |
| 71 | +CACHE_STALE_DAYS = 30 # Log warning if cache older than this |
| 72 | + |
52 | 73 | # Maximum repaired tool IDs to track (LRU eviction) |
53 | 74 | MAX_REPAIRED_TOOL_IDS = 1000 |
54 | 75 |
|
|
128 | 149 | # They are NOT documented but conflict with custom tools. |
129 | 150 | "report_intent", # Hidden: Causes hang if custom tool uses same name |
130 | 151 | "task", # Hidden: Causes hang if custom tool uses same name |
| 152 | + # ───────────────────────────────────────────────────────────────────────── |
| 153 | + # Additional built-ins discovered via archaeology (2026-02-09) and live |
| 154 | + # testing (2026-02-16). Bug: GHCP-BUILTIN-TOOLS-001 |
| 155 | + # Evidence: ST04 session, binary analysis, Gemini live test |
| 156 | + # ───────────────────────────────────────────────────────────────────────── |
| 157 | + "create", # File ops: ST04 session - "Tool 'create' not found" |
| 158 | + "shell", # Shell: 2026-02-09 archaeology |
| 159 | + "report_progress", # Think: 2026-02-09 archaeology (CLI session UI) |
| 160 | + "update_todo", # Think: 2026-02-09 archaeology |
| 161 | + "skill", # Other: 2026-02-09 archaeology |
| 162 | + "fetch_copilot_cli_documentation", # Fetch: 2026-02-16 live Gemini test |
| 163 | + "search_code_subagent", # Search: 2026-02-16 binary analysis |
| 164 | + "github-mcp-server-web_search", # Search: 2026-02-16 binary analysis (MCP) |
| 165 | + "task_complete", # Task: 2026-02-17 forensic session 1541c502 |
131 | 166 | } |
132 | 167 | ) |
133 | 168 |
|
@@ -219,4 +254,17 @@ class LoopExitMethod(Enum): |
219 | 254 | # These are not documented but cause session hangs if user tool has same name. |
220 | 255 | "report_intent": frozenset({"report_intent"}), # Hidden: Always exclude |
221 | 256 | "task": frozenset({"task"}), # Hidden: Always exclude |
| 257 | + # ───────────────────────────────────────────────────────────────────────── |
| 258 | + # Additional built-ins (Bug GHCP-BUILTIN-TOOLS-001, 2026-02-17) |
| 259 | + # ───────────────────────────────────────────────────────────────────────── |
| 260 | + "create": frozenset({"write_file"}), # Maps to write_file (same as edit) |
| 261 | + "shell": frozenset({"bash"}), # Maps to bash |
| 262 | + "update_todo": frozenset({"todo"}), # Maps to todo |
| 263 | + "skill": frozenset({"load_skill"}), # Maps to load_skill |
| 264 | + "search_code_subagent": frozenset({"grep", "glob", "delegate"}), # Composite tool |
| 265 | + "github-mcp-server-web_search": frozenset({"web_search"}), # MCP web search |
| 266 | + # Pure exclusions — no direct Amplifier equivalent |
| 267 | + "report_progress": frozenset({"todo"}), # Partial: maps to todo for task tracking |
| 268 | + "fetch_copilot_cli_documentation": frozenset(), # CLI-specific, no equivalent |
| 269 | + "task_complete": frozenset({"todo"}), # Task completion: maps to todo |
222 | 270 | } |
0 commit comments