feat(cli): Partial threading of AgentLoopContext. (#22978)

This commit is contained in:
joshualitt
2026-03-19 09:02:13 -07:00
committed by GitHub
parent 9053f409f5
commit ed9e47d76e
68 changed files with 608 additions and 421 deletions
+14 -7
View File
@@ -27,7 +27,8 @@ import { HooksDialog } from '../components/HooksDialog.js';
function panelAction(
context: CommandContext,
): MessageActionReturn | OpenCustomDialogActionReturn {
const { config } = context.services;
const agentContext = context.services.agentContext;
const config = agentContext?.config;
if (!config) {
return {
type: 'message',
@@ -55,7 +56,8 @@ async function enableAction(
context: CommandContext,
args: string,
): Promise<void | MessageActionReturn> {
const { config } = context.services;
const agentContext = context.services.agentContext;
const config = agentContext?.config;
if (!config) {
return {
type: 'message',
@@ -108,7 +110,8 @@ async function disableAction(
context: CommandContext,
args: string,
): Promise<void | MessageActionReturn> {
const { config } = context.services;
const agentContext = context.services.agentContext;
const config = agentContext?.config;
if (!config) {
return {
type: 'message',
@@ -163,7 +166,8 @@ function completeEnabledHookNames(
context: CommandContext,
partialArg: string,
): string[] {
const { config } = context.services;
const agentContext = context.services.agentContext;
const config = agentContext?.config;
if (!config) return [];
const hookSystem = config.getHookSystem();
@@ -183,7 +187,8 @@ function completeDisabledHookNames(
context: CommandContext,
partialArg: string,
): string[] {
const { config } = context.services;
const agentContext = context.services.agentContext;
const config = agentContext?.config;
if (!config) return [];
const hookSystem = config.getHookSystem();
@@ -209,7 +214,8 @@ function getHookDisplayName(hook: HookRegistryEntry): string {
async function enableAllAction(
context: CommandContext,
): Promise<void | MessageActionReturn> {
const { config } = context.services;
const agentContext = context.services.agentContext;
const config = agentContext?.config;
if (!config) {
return {
type: 'message',
@@ -280,7 +286,8 @@ async function enableAllAction(
async function disableAllAction(
context: CommandContext,
): Promise<void | MessageActionReturn> {
const { config } = context.services;
const agentContext = context.services.agentContext;
const config = agentContext?.config;
if (!config) {
return {
type: 'message',