Skip to content

AgentCard --watch: minimal incremental refresh (mtime/size, per-card reload, safe parse) #603

@iqdoctor

Description

@iqdoctor

Summary

Propose a minimal incremental refresh path for --watch on AgentCard roots to avoid full app rebuilds, handle partial writes safely, and update only affected agents.

Scope

Applies to --watch for AgentCard roots.

Proposed behavior

  • Detect changes using mtime + size; reload only changed card files.
  • If a card fails to parse (empty/partial write), log a warning and skip; retry on next change.
  • If a tool file changes, reload only cards that reference that tool file.
  • Handle removals by unregistering the agent and updating the available agent list without restarting the session.
  • Refresh only affected agent instances (no full app rebuild):
    • instance_scope=shared: swap updated agents in place
    • instance_scope=request/connection: bump registry version so new instances see the update
  • UX: emit a short “AgentCards reloaded” line and refresh the available agent list.

Why

  • Avoids unnecessary full reloads for small edits
  • Prevents crashes on partial writes during save
  • Enables smooth REPL workflows (add/modify/delete cards live)

Notes

This is intentionally minimal; deeper dependency/graph handling can follow later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions