patched-codes / patchwork

Automate code reviews, patching and documentation with LLM workflows.
https://patched.codes
GNU Affero General Public License v3.0
112 stars 9 forks source link

When the context is larger then the context_token_length warn the user #269

Open codelion opened 1 week ago

codelion commented 1 week ago

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 - https://github.com/patched-codes/patchwork/blob/f1b107ab86c70a246691fc3062d561dd098a75ff/patchwork/steps/ExtractCode/ExtractCode.py#L32).

As a result the patchflow may fail to execute and the only the 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.

patched-admin commented 1 week ago

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