Skip to content
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

🐛 Fixing up the symbol not found and dependency agents #655

Merged

Conversation

shawn-hurley
Copy link
Contributor

  • Make it so that the FQDN agent doesn't cause LLM to cycle on itself
  • Make it so the FQDN agent has a system prompt, that will help with
    context window issues
  • Make it so that the SymbolNotFound issues go to the maven compiler.
    This is because if the dependency is missing from the project both a
    symbol not found and a package does not exist are created. If just a
    symbol not found, then the issue is the Class changed.

This is built on #653 to make debugging easier.

After this change, with openshift-ai, I can fix the DatabaseMigrationStartup.java file in around 6 minutes, where before it was taking upwards of 20-30.

fixes #650



@dataclass
class DependencyValidationError(ValidationError):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fabianvf I don't see this used anywhere so I removed if I could get a second pair of eyes that would be great.

@shawn-hurley shawn-hurley force-pushed the bugfix/fixing-dep-and-symbol-agents branch 3 times, most recently from 4977d3e to d5af502 Compare February 14, 2025 19:55
@@ -26,6 +26,22 @@ class FQDNDependencySelectorRequest(AgentRequest):
query: list[str]
times: int

def from_selector_request(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed to pass cache_path_resolver to the next run of execute.

@@ -42,22 +58,22 @@ class __llm_response:
def __init__(self, model_provider: ModelProvider) -> None:
self._model_provider = model_provider

message = Template(
system_tmpl = Template(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a system template makes the context window smaller and the LLM behave better.

@@ -21,8 +21,6 @@ class MavenCompilerAgent(Agent):
"""{{ background }}
I will give you compiler errors and the offending line of code, and you will need to use the file to determine how to fix them. You should only use compiler errors to determine what to fix.

Make sure that the references to any changed types are kept.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allows the LLM to revert certain things and, in my testing, gets slightly better results for specific situations.

It is imperfect, and if we need to add it back, we can.

Copy link
Contributor

@JonahSussman JonahSussman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Not specific to this PR, but there's some funkiness happening with how we handle Tasks and Agents

SymbolNotFoundError,
PackageDoesNotExistError,
)
handled_type = (PackageDoesNotExistError,)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when a symbolnotfound is actually caused because of a missing dep?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A package not found error is also present and happens before that. There are then two scenarios because packages not found are handled first.

  1. We added the package, and this issue is resolved indirectly
  2. We were unable to add the package. This could be because it is a bad update (see the Jakarta.sql) example, in the case we need to back out the specific change, in other cases, it may be that the name of the thing has changed or something. In this case, it is not a package error; it is an error in that file that needs to be fixed.

* This makes it easier to determine what the path should be for each
  task, as tasks have more and more divergent data
* Removes the cache overwrite for SymbolNotFound and
  PackageDoesNotExistErrors
* Adds the depth to file tree to see effort level at work.
* In the future we should consider enhancing this, so that tasks can add
  data to the trace to make debugging even easier

Signed-off-by: Shawn Hurley <shawn@hurley.page>
* Make it so that the FQDN agent doesn't cause LLM to cycle on itself
* Make it so the FQDN agent has a system prompt, that will help with
  context window issues
* Make it so that the SymbolNotFound issues go to the maven compiler.
  This is because if the dependency is missing from the project both a
symbol not found and a package does not exist are created. If just a
symbol not found, then the issue is the Class changed.

Signed-off-by: Shawn Hurley <shawn@hurley.page>
@shawn-hurley shawn-hurley force-pushed the bugfix/fixing-dep-and-symbol-agents branch from d5af502 to f9b2b8b Compare February 17, 2025 14:12
@fabianvf fabianvf merged commit 4a177d6 into konveyor:main Feb 17, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] FQDN Search agent will put the LLM in a logic cycle
4 participants