agent-host-chat-contributions

Implement and review cross-cutting agent-host chat behavior through lifecycle contribution hooks.

Updated Aug 30, 2026
One-click install
npx skills add https://github.com/Tyrizx/Tyrizx --skill agent-host-chat-contributions-tyrizx
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: agent-host-chat-contributions
Source: https://github.com/Tyrizx/Tyrizx/tree/main/.github/skills/agent-host-chat-contributions
Command: npx skills add https://github.com/Tyrizx/Tyrizx --skill agent-host-chat-contributions-tyrizx

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Cross-cutting chat behaviors in the VS Code agent host tend to accumulate inside large orchestration classes like AgentSideEffects and AgentService, creating unmaintainable code. This Skill guides you to build such behaviors as self-contained, dependency-injected lifecycle contributions instead, and to review changes that violate that boundary. ## Core Features & Use Cases - Contribution Model Guidance: Explains the seven lifecycle hooks (onIncomingRequest, onTurnEnd, onDidApplyClientAction, onDidDispatchAction, onOutgoingTurn, onHydrateTurns, onHydrateChat) and when each applies. - Architecture Decision Rules: Provides a decision test for whether behavior belongs in a contribution versus routing fabric, provider-shaped mapping, or orchestration classes. - Ordering, Mementos, and Failure Isolation: Documents load-bearing hook ordering, memento lifecycle and eviction, and the fail-closed semantics of admission gating. - Use Case: When adding a feature like turn admission gating or restored-history transformation, use this Skill to create a properly registered contribution with correct order, tests, and dispatcher integration instead of bloating AgentSideEffects. ## Quick Start Ask the agent to add a new cross-cutting chat behavior, such as intercepting outgoing turns to inject context, as a registered chat contribution following the lifecycle hook model.

Frequently Asked Questions about agent-host-chat-contributions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new cross-cutting chat behavior to the agent host?▼

Create a class implementing IAgentHostChatContribution with a unique static id, an explicit order, and a constructor taking IAgentHostChatContributionContext plus injected services. Register it once in builtInChatContributions.ts and place it in its own directory under node/chatContributions/.

When should code go in a contribution instead of AgentSideEffects?▼

Use a contribution when the behavior reacts to a named lifecycle moment, can be owned by a registered dependency-injected unit, and composes in a defined order. Routing fabric, turn-id remapping, and provider-shaped SDK mappers stay in AgentSideEffects.

What are the seven agent host chat contribution hooks?▼

The hooks are onIncomingRequest, onTurnEnd, onDidApplyClientAction, onDidDispatchAction, onOutgoingTurn, onHydrateTurns, and onHydrateChat. Each fires at a distinct lifecycle moment, from admission gating through turn dispatch to chat restoration.

Why does onIncomingRequest fail closed while other hooks isolate failures?▼

onIncomingRequest is a synchronous admission gate, so a throwing contribution rejects the request with internalError rather than letting it proceed. Observer and hydration hooks isolate failures because losing one enrichment is preferable to losing chat history or blocking unrelated behavior.

How does contribution ordering work in the dispatcher?▼

The dispatcher sorts contributions by their explicit order value, lower first, with registration order breaking ties. Ordering is per hook and load-bearing, so new contributions should get distinct orders and sequence changes need regression test updates.

Why do tests fail with UNKNOWN service after adding a contribution dependency?▼

Hand-built test ServiceCollections that construct AgentSideEffects or call registerBuiltInChatContributions each need the new service registered. Add the registration to those test graphs rather than weakening assertions, since the failure means the test graph was incomplete.