Skip to content

AgentLoopContext is incompatible with Config type #22920

Description

@mini2s

What happened?

AgentLoopContext is incompatible with Config type

export async function deleteSession(
  config: Config,
  sessionIndex: string,
): Promise<void> {
  .....
  try {
    // Use ChatRecordingService to delete the session
    const chatRecordingService = new ChatRecordingService(config);
    chatRecordingService.deleteSession(sessionToDelete.file);

    const time = formatRelativeTime(sessionToDelete.lastUpdated);
    writeToStdout(
      `Deleted session ${sessionToDelete.index}: ${sessionToDelete.firstUserMessage} (${time})`,
    );
  } catch (error) {
    writeToStderr(
      `Failed to delete session: ${error instanceof Error ? error.message : 'Unknown error'}`,
    );
  }
}
export class ChatRecordingService {
  private conversationFile: string | null = null;
  private cachedLastConvData: string | null = null;
  private cachedConversation: ConversationRecord | null = null;
  private sessionId: string;
  private projectHash: string;
  private kind?: 'main' | 'subagent';
  private queuedThoughts: Array<ThoughtSummary & { timestamp: string }> = [];
  private queuedTokens: TokensSummary | null = null;
  private context: AgentLoopContext;

  constructor(context: AgentLoopContext) {
    this.context = context;
    this.sessionId = context.promptId;
    this.projectHash = getProjectHash(context.config.getProjectRoot());
  }
  .....
}

What did you expect to happen?

Fix ChatRecordingService initialization error

Client information

Client Information

Run gemini to enter the interactive CLI, then run the /about command.

> /about
# paste output here

Login information

No response

Anything else we need to know?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area/agentIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Qualityhelp wantedWe will accept PRs from all issues marked as "help wanted". Thanks for your support!kind/bugpriority/p2Important but can be addressed in a future release.status/bot-triagedstatus/need-information

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions