-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include workspace contents if any at first step only. #30
Conversation
@CodiumAI-Agent /review |
PR Reviewer Guide 🔍
|
@CodiumAI-Agent /ask
It lists files only in the first level.
Workspace will always be there. |
Ask❓
Answer:Performance ConcernThe use of
Possible BugThe code currently does not handle exceptions that might be raised by try:
workspace_contents = ', '.join(os.listdir(config.workspace_base))
if workspace_contents:
messages.append(
Message(
role='user',
content=[
TextContent(text=f'WORKSPACE CONTENTS: {workspace_contents}')
],
)
)
except FileNotFoundError:
# Handle the case where the directory does not exist
messages.append(
Message(
role='user',
content=[
TextContent(text='WORKSPACE CONTENTS: Directory not found')
],
)
)
except PermissionError:
# Handle the case where there are permission issues
messages.append(
Message(
role='user',
content=[
TextContent(text='WORKSPACE CONTENTS: Permission denied')
],
)
) By handling these exceptions, you ensure that your application can gracefully handle unexpected situations, improving its robustness and reliability. |
@CodiumAI-Agent /ask
context will be missed. |
Ask❓
Answer:The new code introduced in the PR does not specifically address the selection of the first 10 files or any specific number of files. Instead, it focuses on including the contents of the workspace directory in the initial message if there is only one event in the state history. This is done to provide an overview of the workspace contents early in the process, which can help in understanding the context without needing to generate embeddings for all files immediately. Here is a breakdown of the relevant new code: if len(state.history.get_events_as_list()) == 1:
workspace_contents = ', '.join(os.listdir(config.workspace_base))
if workspace_contents:
messages.append(
Message(
role='user',
content=[
TextContent(
text=f'WORKSPACE CONTENTS: {workspace_contents}'
)
],
)
) This code checks if the state history contains only one event. If so, it lists the contents of the workspace directory and appends this information as a message to the To address the concern about missing context for the first 10 files, you might consider implementing additional logic to selectively include more detailed information about a subset of files if needed. However, this specific PR does not include such functionality. |
What is the problem that this fixes or functionality that this introduces? Does it fix any open issues?
Closes All-Hands-AI#2838
Applying the initial idea from All-Hands-AI#2865 (comment)
Generating embeddings for all files is taking time. (~1 minute)
It should be a user preference for time vs cost.