Skip to content

Files added to context with unexpected relative path #15343

@colin-grant-work

Description

@colin-grant-work

Bug Description:

Steps to Reproduce:

  1. Ask Coder to add a file to the context using its relative path. (e.g. open the Theia repo and say something like

@coder can you put examples/api-samples/src/browser/chat/change-set-chat-agent-contribution.ts in context?

  1. Coder should add it to the context.
  2. Observe that the chat display shows the relative path as though it were absolute (with an initial /).

Image

Behind the scenes, we instruct the agent to provide absolute paths, and we effectively expect absolute paths, but Coder doesn't really know about absolute paths. Fortunately most of the chat machinery works fine with relative paths, so the mismatch doesn't have much practical impact.

description: 'The absolute paths of files to add to the context of the current chat.',
items: { type: 'string' }
}
},
required: ['filesToAdd']
},
description: 'Adds one or more files to the context of the current chat session, and returns the current list of files in the context.',
handler: async (arg: string, ctx: MutableChatRequestModel): Promise<string> => {
const { filesToAdd } = JSON.parse(arg) as { filesToAdd: string[] };
ctx.session.context.addVariables(...filesToAdd.map(file => ({ arg: file, variable: FILE_VARIABLE })));

Additional Information

  • Operating System: Mac OSX Sequoia
  • Theia Version: c49fd50

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugbugs found in the applicationtheia-aiissues related to TheiaAI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions