feat(remote): support per-conversation working directories in listener mode (#1323)
This commit is contained in:
@@ -242,14 +242,11 @@ export function ConversationSelector({
|
||||
let defaultConversation: EnrichedConversation | null = null;
|
||||
if (!afterCursor) {
|
||||
try {
|
||||
const defaultMessages = await client.conversations.messages.list(
|
||||
"default",
|
||||
{
|
||||
limit: 20,
|
||||
order: "desc",
|
||||
agent_id: agentId,
|
||||
},
|
||||
);
|
||||
const defaultMessages = await client.agents.messages.list(agentId, {
|
||||
conversation_id: "default",
|
||||
limit: 20,
|
||||
order: "desc",
|
||||
});
|
||||
const defaultMsgItems = defaultMessages.getPaginatedItems();
|
||||
if (defaultMsgItems.length > 0) {
|
||||
const defaultStats = getMessageStats(
|
||||
|
||||
@@ -24,6 +24,7 @@ export type ClassifyApprovalsOptions<TContext = ApprovalContext | null> = {
|
||||
getContext?: (
|
||||
toolName: string,
|
||||
parsedArgs: Record<string, unknown>,
|
||||
workingDirectory?: string,
|
||||
) => Promise<TContext>;
|
||||
alwaysRequiresUserInput?: (toolName: string) => boolean;
|
||||
treatAskAsDeny?: boolean;
|
||||
@@ -31,6 +32,7 @@ export type ClassifyApprovalsOptions<TContext = ApprovalContext | null> = {
|
||||
missingNameReason?: string;
|
||||
requireArgsForAutoApprove?: boolean;
|
||||
missingArgsReason?: (missing: string[]) => string;
|
||||
workingDirectory?: string;
|
||||
};
|
||||
|
||||
export async function getMissingRequiredArgs(
|
||||
@@ -74,9 +76,13 @@ export async function classifyApprovals<TContext = ApprovalContext | null>(
|
||||
approval.toolArgs || "{}",
|
||||
{},
|
||||
);
|
||||
const permission = await checkToolPermission(toolName, parsedArgs);
|
||||
const permission = await checkToolPermission(
|
||||
toolName,
|
||||
parsedArgs,
|
||||
opts.workingDirectory,
|
||||
);
|
||||
const context = opts.getContext
|
||||
? await opts.getContext(toolName, parsedArgs)
|
||||
? await opts.getContext(toolName, parsedArgs, opts.workingDirectory)
|
||||
: null;
|
||||
let decision = permission.decision;
|
||||
|
||||
|
||||
@@ -159,12 +159,12 @@ export async function runMessagesSubcommand(argv: string[]): Promise<number> {
|
||||
return 1;
|
||||
}
|
||||
|
||||
const response = await client.conversations.messages.list("default", {
|
||||
const response = await client.agents.messages.list(agentId, {
|
||||
conversation_id: "default",
|
||||
limit: parseLimit(parsed.values.limit, 20),
|
||||
after: parsed.values.after,
|
||||
before: parsed.values.before,
|
||||
order,
|
||||
agent_id: agentId,
|
||||
});
|
||||
|
||||
const messages = response.getPaginatedItems() ?? [];
|
||||
|
||||
Reference in New Issue
Block a user