Conversation
…e-driven alternatives
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
nhopeatall
left a comment
There was a problem hiding this comment.
Summary
LGTM — Clean, well-scoped refactor that replaces 3 hardcoded agentType === 'review' checks with profile-driven alternatives. All CI checks pass. The changes are backward-compatible and the test coverage is thorough.
Notes
-
sidecarManager.ts: Correctly switches from
agentType === 'review'toprofile.finishHooks.requiresReview. The_agentTypeparameter rename is a reasonable choice for backward compatibility with callsites — removing it would be cleaner but would require updatingsecretOrchestrator.tsand all test callsites. -
github-token-resolver.ts: Delegating to
getPersonaForAgentType()is the right move — it centralizes the agent→persona mapping inAGENT_PERSONA_MAPrather than spreading hardcoded checks. The behavior is identical for existing agent types. -
tracking.ts: The
loopAdviceProfilefield with explicit'review' | 'default'union is a good design choice — more self-documenting than a boolean and extensible if more profiles are needed later. The precedence logic (loopAdviceProfileoverridesagentTypewhen defined) is correct with clean fallback. -
llmist/index.ts: The derivation
profile.finishHooks.requiresReview ? 'review' : 'default'correctly handles theundefinedcase (falsy →'default'). -
personas.ts: The added JSDoc clearly documents
AGENT_PERSONA_MAPas the registration point for custom agent personas. Good guidance for future contributors. -
Tests: New tests properly verify both the positive case (custom agent with
requiresReview: truegets review behavior) and the override case (loopAdviceProfiletakes precedence overagentType). Existing tests are updated with appropriatefinishHooksin mock profiles.
🕵️ claude-code · claude-opus-4-6 · run details
Summary
Replaces 3 hardcoded
agentType === 'review'checks with profile-based alternatives, enabling custom agent types with review-like behavior to work correctly without requiring the hardcoded string'review'.profile.finishHooks.requiresReviewinstead ofagentType === 'review'for review sidecar creationgetPersonaForAgentType()frompersonas.tsto delegate toAGENT_PERSONA_MAPfor reviewer token selectionloopAdviceProfilefield toTrackingContext, derived fromfinishHooks.requiresReview, so loop messages are profile-driven rather than hardcodedAGENT_PERSONA_MAPdocumenting it as the registration point for custom agent personasloopAdviceProfilefrom profile intocreateTrackingContext()Test plan
sidecarManager.test.ts: new test verifies custom agent withrequiresReview: truegets review sidecargithub-token-resolver.test.ts: mockedgetPersonaForAgentType, verified persona-based token selection for both reviewer and implementer custom agentstracking.test.ts: new tests verifyloopAdviceProfile: 'review'yields review loop advice even for non-'review'agentType, andloopAdviceProfile: 'default'overridesagentType: 'review'adapter.test.tsandllmist.test.tsto use profile-basedfinishHooksin mock profilesKey decisions
_agentTypeparameter kept increateCompletionArtifactssignature for backward compatibility with all callsites (only renamed to avoid unused-variable TS error)loopAdviceProfileuses explicit'review' | 'default'union rather than a boolean to be self-documenting and extensiblegetPersonaForAgentTypestays synchronous —AGENT_PERSONA_MAPremains the single source of truthTrello card: https://trello.com/c/vSEx24UJ/580-13-hardcoded-agenttype-review-checks-scattered-across-source-found-in-src-backends-sidecarmanagerts37-src-router-github-token-re
🤖 Generated with Claude Code
🕵️ claude-code · claude-sonnet-4-6 · run details