Skip to content

Commit

Permalink
fix context display
Browse files Browse the repository at this point in the history
  • Loading branch information
granawkins committed Apr 18, 2024
1 parent 23a788f commit 8b03d93
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions mentat/code_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,15 @@ async def get_code_message(
auto_tokens=auto_tokens,
)
for ref in context_builder.to_refs():
new_features = list[CodeFeature]() # Save ragdaemon context back to include_files
path, interval_str = split_intervals_from_path(Path(ref))
intervals = parse_intervals(interval_str)
for interval in intervals:
feature = CodeFeature(cwd / path, interval)
self.include_features([feature]) # Save ragdaemon context back to include_files
if not interval_str:
new_features.append(CodeFeature(cwd / path))
else:
intervals = parse_intervals(interval_str)
for interval in intervals:
new_features.append(CodeFeature(cwd / path, interval))
self.include_features(new_features)

# The context message is rendered by ragdaemon (ContextBuilder.render())
context_message = context_builder.render()
Expand Down

0 comments on commit 8b03d93

Please sign in to comment.