patched-codes / patchwork

Automate development gruntwork like code reviews, patching and documentation with LLM workflows.

Home Page:https://patched.codes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When the context is larger then the context_token_length warn the user

codelion opened this issue · comments

In the get_source_code_context method in the ExtractCode.py file. If the context is larger than the context_token_length we just return None, None as position (as seen here -

return position.start, position.end
).

As a result the patchflow may fail to execute and the only thing user sees is No context found. Instead we should warn them with a logger.warn and suggest that the context selected is larger than the context_token_length and they can increase the context_token_length to process the larger context.

The following files in the repository may be relevant to the issue:


  • patchwork/steps/ExtractCodeMethodForCommentContexts/ExtractCodeMethodForCommentContexts.py
  • patchwork/steps/ExtractCodeContexts/ExtractCodeContexts.py
  • patchwork/common/context_strategy/generic.py
  • patchwork/steps/ExtractCode/ExtractCode.py
  • patchwork/common/client/patched.py
  • patchwork/app.py
  • patchwork/steps/CreateIssueComment/CreateIssueComment.py