Repository navigation
Restore the test suite and satisfy Credo strict - #22
Conversation
Co-authored-by: Jeff <gofenix@users.noreply.github.com>
Heartbeat again records failed daily and weekly evolution cycles, and a failed weekly cycle does not advance its cooldown. The runner records correction signals, successful memory refreshes increment the evolution counter, and skill search includes package content again. MemoryUpdater keeps the refresh queue moving when a job task exits. Tests now follow the current runtime identity copy, memory status payload, refresh prompt heading, and memory tool descriptions. Co-authored-by: Jeff <gofenix@users.noreply.github.com>
Rewrite single-clause conditionals, redundant with clauses, and over-complex functions so the configured Credo checks pass. No checks were disabled and no credo:disable comments were added. Co-authored-by: Jeff <gofenix@users.noreply.github.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e16efdb1f1
ℹ️ 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".
| |> Keyword.take([ | ||
| :workspace, | ||
| :provider, | ||
| :model, | ||
| :api_key, |
There was a problem hiding this comment.
Forward the refresh provider and model to evolution
When a session uses a provider or model different from the global configuration, every fifth successful refresh starts evolution with the wrong LLM configuration. MemoryUpdater.run_job/1 passes provider and model as positional arguments to Memory.refresh/4, not in opts, so taking these keys here never captures them. Evolution.resolve_runtime_llm_opts/1 consequently falls back to the global provider/model while retaining the session's API key and base URL, causing authentication or unsupported-model failures. Pass the effective positional provider and model into the evolution options.
Useful? React with 👍 / 👎.
| _ = Nex.Agent.Evolution.maybe_trigger_after_consolidation(evolution_opts) | ||
| outcome |
There was a problem hiding this comment.
Serialize automatic evolution with subsequent memory refreshes
When another refresh is queued for the same workspace, this new hook can silently lose evolution's memory updates. maybe_trigger_after_consolidation/1 launches an asynchronous task and returns immediately, allowing MemoryUpdater to start the next job. That job snapshots MEMORY.md before its LLM call; if evolution appends a memory update while that call is running, the refresh subsequently replaces the entire file with a result based on the older snapshot, erasing the appended update despite a successful evolution audit entry. Coordinate evolution writes with the workspace's refresh queue, or otherwise prevent stale refresh results from overwriting concurrent updates.
Useful? React with 👍 / 👎.
Summary
Makes
mix format --check-formatted,mix credo --strict, andMIX_ENV=test mix testpass on Elixir 1.19.4 / OTP 28.2. Formatting, behavior fixes, and Credo refactors are separate commits. No tests were deleted or skipped. No Credo checks were disabled, and nocredo:disablecomments were added.Formatting
mix formatonly (9ebc0ac). No logic change.Runtime identity
ffc5555intentionally dropped the default "Nex Agent" persona in favor of workspace layers (SOUL.mdand the rest). Assertions now match## Runtime Identityand "No default persona is imposed by the runtime."Memory status
ffd5628replaced the old ready/blocked/threshold payload withpending/idle/running/queued/unknownand reasons such asunreviewed_messages. The stale-consolidation test now checks that legacy flags do not change that status.Memory refresh prompt
## Conversation to Process.Memory tool descriptions
Heartbeat evolution
{:weekly_evolution_done, ...}handler remained. Failed cycles are recorded again, and a failed weekly cycle does not advance the cooldown.Correction signals
Runneragain records correction and tool-error signals before enqueueing a memory refresh.Evolution counter
Skill discovery
manifest.contentagain, so body words such as "operations checklist" are discoverable. The registry still only loadsrt__andgh__directories.Memory refresh queue
MemoryUpdatercould stay stuck oncurrentwhen a job exited without{:job_finished, ...}(the prompt-heading crash did this and then blocked later refreshes, including inbound and runner tests). Jobs are monitored by reference, and exceptions are turned into{:error, ...}before the next job starts.Credo
e16efdb. Behavior is unchanged.condbecameif(memory,request_trace,runner,validator,feishu_task).withthat only forwarded one clause becamecase, or the final call moved into thedoblock (feishu,github_project_poller,skills,tasks,skill_get,validator).Enum.map |> Enum.joinbecameEnum.map_join, and twoEnum.filterpasses became one (evolution,runner,opencode_run,store,validator,tasks,personal_summary).if not enabled?was flipped (skill_runtime).is_openrouter_endpoint?/1was renamed toopenrouter_endpoint?/1.Config.request_trace/1andConfig.skill_runtime/1calls replacedapply/3. Both functions exist.InboundWorker.dispatch_async/6(complexity 28, max 25) andMessage.execute/2were split into helpers.SkillRuntime.prepare_run/2was split so nesting stays within 5, and selection still stops before importing another package oncemax_selectedis reached.Verification
Local CI sequence from
.github/workflows/ci.yml:mix format --check-formattedpassedmix credo --strictpassedMIX_ENV=test mix test --seed 0: 250 tests, 0 failuresmix dialyzerstill exits 2 with the same 51 warnings as the parent commit (line numbers shift only where this branch edited a file). Those warnings are pre-existing, including unused helpers inskill_runtime/evolver.exand pattern mismatches inknowledge.ex,admin.ex, andfeishu.ex. They were not added to.dialyzer_ignore.exs.Do not merge; this is ready for review.