Skip to content

fix: use fixed agent ID for hand agents based on hand_id#520

Open
houko wants to merge 3 commits intoRightNow-AI:mainfrom
houko:fix/hand-agent-fixed-id
Open

fix: use fixed agent ID for hand agents based on hand_id#520
houko wants to merge 3 commits intoRightNow-AI:mainfrom
houko:fix/hand-agent-fixed-id

Conversation

@houko
Copy link

@houko houko commented Mar 11, 2026

Summary

This ensures triggers and cron jobs continue to work after daemon restart, as hand agents now have stable IDs instead of generating a new UUID each time.

Changes

  1. Add AgentId::from_string() method in crates/openfang-types/src/agent.rs

    • Uses SHA-1 namespace (UUID v5) to generate deterministic IDs from strings
  2. Modify spawn_agent_with_parent() in crates/openfang-kernel/src/kernel.rs

    • Add optional fixed_id parameter
  3. Use fixed ID in activate_hand()

    • Hand agents now use AgentId::from_string(hand_id) for stable identity

Why this is better than reassign

Instead of adding reassign logic (like cron jobs have), we make hand agent IDs stable from the start. This is cleaner and doesn't require maintaining a mapping table.

See: #519

houko added 3 commits March 11, 2026 23:09
This ensures triggers and cron jobs continue to work after daemon restart,
as hand agents now have stable IDs instead of generating a new UUID each time.

Changes:
- Add AgentId::from_string() method for deterministic ID generation
- Modify spawn_agent_with_parent() to accept optional fixed_id
- Use hand_id-based fixed ID in activate_hand()

See: RightNow-AI#519
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