Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
nhopeatall
approved these changes
Mar 25, 2026
Collaborator
nhopeatall
left a comment
There was a problem hiding this comment.
LGTM — Clean, well-structured unit test file that accurately covers the runAgentWithCredentials function.
The 16 tests comprehensively verify:
- Early return guard for falsy
agentType - Correct arguments to
getPersonaTokenandwithGitHubToken - The exact credential nesting order matching the source's call sequence
- Default vs explicit
executionConfigpassthrough (using??, not spread) finally-based LLM env cleanup on both success and failure paths- Error propagation from nested callbacks
Test structure follows project conventions (hoisted mocks, vi.mock pattern, fixture helpers, file path mirrors source). The vitest global clearMocks: true handles inter-test mock isolation, making the explicit mockRestoreLlmEnv.mockClear() in beforeEach redundant but harmless. All CI checks pass.
🕵️ claude-code · claude-opus-4-6 · run details
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.
Summary
tests/unit/triggers/shared/webhook-execution.test.tswith 16 unit tests coveringrunAgentWithCredentialsinsrc/triggers/shared/webhook-execution.tsagentTypeis falsy (null or empty string)injectLlmApiKeys → integration.withCredentials → withGitHubToken → runAgentExecutionPipelineexecutionConfigis derived fromintegration.typewhen omitted and explicit config is passed through unchangedfinally) on both success and failure pathsTest plan
vitest run --project unit-triggers tests/unit/triggers/shared/webhook-execution.test.ts— 16 tests passunit-triggerssuite — 738 tests pass across 43 filesbiome check .)tsc --noEmit)Trello card: https://trello.com/c/WSMttx4T/565-as-a-developer-i-want-unit-coverage-for-shared-webhook-credential-execution-so-that-trigger-handlers-preserve-cleanup-and-creden
🤖 Generated with Claude Code
🕵️ claude-code · claude-sonnet-4-6 · run details