Skip to content

Commit

Permalink
(autofix) Tweaks for thought visbility and getting Claude working aga…
Browse files Browse the repository at this point in the history
…in (#961)

1. Bump Claude-related package versions to fix weird bug in Anthropic
SDK
2. Remove unnecessary langfuse trace update
3. Tweak prompts and logs to improve thought visibility
  • Loading branch information
roaga authored Jul 25, 2024
1 parent 374c4ff commit d845226
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ johen==0.1.5
pydantic-xml==2.9.0
chromadb==0.4.14
google-cloud-storage==2.16.0
google-cloud-aiplatform==1.59.0
anthropic[vertex]==0.31.1
google-cloud-aiplatform==1.60.0
anthropic[vertex]==0.31.2
langfuse @ git+https://github.com/jennmueng/langfuse-python.git@0643fdd4a7511eba31b522362cfc929b20b37d3b
watchdog
stumpy==1.12.0
1 change: 0 additions & 1 deletion src/seer/automation/agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ def run_iteration(self, context: Optional[AutofixContext] = None):
elif text_before_tag:
text = text_before_tag
if text:
context.event_manager.add_log("Thinking...")
context.event_manager.add_log(text)

if message.tool_calls:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def format_system_msg():
"""\
You are an exceptional principal engineer that is amazing at finding the root cause of any issue.
You have tools to search a codebase to find the root cause of an issue. Please use the tools as many times as you want to find the root cause of the issue. It is very important to be very detailed and clear in your output.
You have tools to search a codebase to find the root cause of an issue. Please use the tools as many times as you want to find the root cause of the issue. It is very important to be very detailed and clear in your output. Before using any tool, explain your reasoning to your colleagues in only one sentence.
Guidelines:
- Don't always assume data being passed is correct, it could be incorrect! Sometimes the API request is malformed, or there is a bug on the client/server side that is causing the issue.
Expand Down
3 changes: 0 additions & 3 deletions src/seer/automation/autofix/steps/steps.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from typing import Any

import sentry_sdk
from langfuse.decorators import langfuse_context

from celery_app.app import celery_app
from seer.automation.autofix.autofix_context import AutofixContext
Expand Down Expand Up @@ -76,8 +75,6 @@ def _get_extra_invoke_kwargs(self) -> dict[str, Any]:
f"{key}:{value}" for key, value in tags.items() if value is not None
] + repo_tags

langfuse_context.update_current_trace(metadata=metadata, tags=langfuse_tags)

return {
"langfuse_tags": langfuse_tags,
"langfuse_metadata": metadata,
Expand Down
7 changes: 5 additions & 2 deletions src/seer/automation/autofix/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def expand_document(self, input: str, repo_name: str | None = None):
repo_name = client.repo_name

self.context.event_manager.add_log(
f"Taking a look at the document at {input} in {repo_name}."
f"Taking a look at the document at `{input}` in `{repo_name}`..."
)

if file_contents:
Expand Down Expand Up @@ -103,6 +103,8 @@ def list_directory(self, path: str, repo_name: str | None = None) -> str:
output.append("Files:")
output.extend(f" {f}" for f in files)

self.context.event_manager.add_log(f"Looking through contents of `{path}`...")

joined = "\n".join(output)
return f"<entries>\n{joined}\n</entries>"

Expand Down Expand Up @@ -141,6 +143,7 @@ def keyword_search(
start_path=in_proximity_to,
)

self.context.event_manager.add_log(f"Searching codebase for `{keyword}`...")
results = searcher.search(keyword)

cleanup_dir(tmp_dir)
Expand Down Expand Up @@ -284,7 +287,7 @@ def store_file_change(self, repo_name: str, file_change: FileChange):
)

self.context.event_manager.add_log(
f"Made a code change in {file_change.path} in {repo_name}."
f"Made a code change in `{file_change.path}` in `{repo_name}`."
)

@observe(name="Replace Snippet")
Expand Down

0 comments on commit d845226

Please sign in to comment.