Open
Conversation
Tests for packages/adapters/src/gemini-cli.ts — previously untested. Covers: - resolveGeminiAgentIdentity: no session, empty/whitespace, hash format, consistency - normalizeGeminiCliAction: all 7 tool mappings (WriteFile, EditFile, ReadFile, Shell, ListFiles, SearchCode, WebSearch), unknown passthrough, missing tool_input - Session ID propagation: payload, GEMINI_SESSION_ID env var, metadata - geminiToActionContext: KE-2 mapping, file/git/shell actions, persona, shape - formatGeminiHookResponse: allow (empty string), deny JSON, guide mode with suggestion and retry exhaustion, educate mode; Gemini-specific 'decision' field - Integration: kernel allow/deny/policy flows with real kernel in dryRun mode - geminiCliToEnvelope: KE-3 source tagging, policyVersion, decisionCodes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jpleva91
added a commit
that referenced
this pull request
Mar 29, 2026
- Health: yellow — PR #1303 (sprint #955/#957) CONFLICTING after PR #1300 merged - PR #1300 MERGED: complete Go kernel (145x faster, 2ms vs 290ms) — major milestone - PR #1295 MERGED: bootstrap catch-22 fix (#995) - PR #1296 MERGED: site-only PR CI skip fix (#1267) - PR #969 MERGED: fix claude-init binary path (closes #964) - PR #1303: sprint work CONFLICTING — senior must assess rebase vs close - No P0/P1 issues open - PR #1317 (Gemini tests, 4/4 CI green, copilot squad): ready for human review - Dogfood #1323 filed: pnpm install --frozen-lockfile bootstrap hang in non-TTY Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Unit tests for
packages/adapters/src/gemini-cli.ts— previously untested at the adapter level. CLI-level tests existed (cli-gemini-hook.test.ts) but didn't cover the core normalization and response-formatting logic.Coverage
resolveGeminiAgentIdentity: no-session fallback, empty/whitespace, hash format and consistency, uniqueness across sessionsnormalizeGeminiCliAction: all 7 tool mappings (WriteFile→Write, EditFile→Edit, ReadFile→Read, Shell→Bash, ListFiles→Glob, SearchCode→Grep, WebSearch→WebFetch), unknown tool passthrough, missingtool_input,source: gemini-climetadata invariantsessionId,GEMINI_SESSION_IDenv var fallback, metadata threading across all tool typesgeminiToActionContext: KE-2 adapter contract — file.write/file.read/git.push/shell.exec action classes, destructive flag, persona pass-through, full ActionContext shapeformatGeminiHookResponse: empty string for allow (Gemini-specific contract), deny JSON withdecisionfield (notpermissionDecision), guide mode with suggestion + retry exhaustion, educate modegeminiCliToEnvelope: KE-3 source tagging, policyVersion and decisionCodes propagationNotes
tool_inputas an object (not a JSON string like Copilot/Codex) — no parse step needed{ decision: 'allow' }) per Gemini CLI contractnode_modules(no turbo), blocking Write hook. Resolved viapnpm install --forcewhich bypasses the interactive reinstall prompt.Created by copilot-test-writer-oss — AgentGuard Copilot swarm