Skip to content

Conversation

@nshkrdotcom
Copy link
Contributor

@nshkrdotcom nshkrdotcom commented Jan 21, 2026

Summary

  • refactor Agent and Skill macros into smaller helper functions to reduce nesting and clarify compile/runtime separation
  • extract complex conditionals into private helpers and standardize aliases for readability
  • adjust lifecycle/timer behavior, InstanceManager restart policy, and logger metadata config
  • apply small idiomatic Elixir cleanups in tests and utilities

Testing

  • not run

- Refactored `Jido.Agent.__using__/1` macro by extracting quoted code into
  separate helper functions to avoid Credo "long quote blocks" and "nested
  too deep" warnings. Compile-time validation and runtime code are now
  clearly separated.

- Applied similar decomposition to `Jido.Skill.__using__/1` macro, breaking
  it into focused helper functions for behaviour setup, accessors, and
  callbacks.

- Extracted complex conditional logic into private helper functions across
  multiple modules (AgentServer, Cron directive, Await, Routes, etc.) to
  improve readability and reduce nesting depth.

- Standardized alias usage throughout codebase: added module aliases at top
  of files and replaced inline module references with aliased versions.

- Fixed idle timer handling in Keyed lifecycle to use `:erlang.start_timer/3`
  with timer refs instead of `Process.send_after/3`, preventing stale timeout
  messages from triggering after cancel/reset.

- Added `restart: :transient` to InstanceManager child specs to avoid
  immediate restarts on normal shutdown/idle timeout while still allowing
  restarts on crashes.

- Added logger configuration for Jido telemetry metadata keys.

- Replaced `length(list) >= N` comparisons with pattern matching or `!= []`
  in tests for more idiomatic Elixir.

- Used `Enum.map_join/3` instead of `Enum.map/2 |> Enum.join/2` where
  applicable.

- Reordered aliases alphabetically in test files for consistency.
@mikehostetler mikehostetler merged commit 45ff4c8 into agentjido:main Jan 23, 2026
6 checks passed
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.

2 participants