Skip to content

Reload history when message files change#6

Open
iqdoctor wants to merge 1 commit intomainfrom
fix/history-mtime-reload
Open

Reload history when message files change#6
iqdoctor wants to merge 1 commit intomainfrom
fix/history-mtime-reload

Conversation

@iqdoctor
Copy link
Member

Summary

  • Track history file mtimes and reload agent history when files are newer than the last loaded snapshot.
  • Include message-history files in the watch set so reloads trigger when history changes.
  • Add unit test to verify history reloads when a message file is updated.

Testing

  • uv run pytest tests/unit/fast_agent/core/test_agent_card_watch.py::test_reload_agents_updates_history_when_file_newer

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 967c8f54a3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +703 to +707
for history_files in self._agent_card_histories.values():
for history_file in history_files:
try:
if history_file.is_relative_to(root):
current_history_files.add(history_file)

Choose a reason for hiding this comment

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

P2 Badge Watch history files for single-card roots

When load_agents is called with a file path (supported by _collect_agent_card_files), root is the card file itself, so history_file.is_relative_to(root) is false for history files in the same directory. That means history files are never added to the watch set for single-card roots, so edits to those message files won’t trigger reload/refresh even though this change intends to watch them. Consider using root.parent when root is a file, or otherwise normalizing the watch root to a directory so history files are included.

Useful? React with 👍 / 👎.

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.

1 participant