Skip to content

fix: preserve agent step limits - #78

Merged
vtemian merged 2 commits into
vtemian:mainfrom
fengjikui:codex/preserve-agent-steps
Jul 30, 2026
Merged

fix: preserve agent step limits#78
vtemian merged 2 commits into
vtemian:mainfrom
fengjikui:codex/preserve-agent-steps

Conversation

@fengjikui

@fengjikui fengjikui commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve existing OpenCode agent fields such as steps/maxSteps when micode overlays plugin agents
  • allow steps and maxSteps through sanitized micode.json agent overrides
  • add regression coverage for both config loading and plugin-agent merging

Root cause

micode built the plugin agent map and then spread those agents directly over config.agent. That replaced the existing OpenCode agent object, so fields configured outside the plugin overlay, including iteration limits such as steps, were silently dropped.

Validation

  • bun run check
  • bun run build
  • git diff --check

Closes #53


Summary by cubic

Preserves user-configured agent iteration limits (steps, maxSteps) when plugin agents overlay OpenCode defaults, and allows these fields in sanitized micode.json overrides.

  • Bug Fixes

    • Merge plugin agents with existing config.agent via mergePluginAgents to keep fields like steps/maxSteps.
    • Allow steps and maxSteps in AgentOverride schema and safe properties.
    • Add regression tests for config loading and agent merge behavior.
  • Refactors

    • Remove redundant type assertions around Object.fromEntries to satisfy typescript-eslint 8.65 rules.

Written for commit 664e196. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 5 files

Re-trigger cubic

Object.fromEntries already yields Record<string, AgentConfig> for a
typed entries array, so the assertion is dead weight under the stricter
no-unnecessary-type-assertion in typescript-eslint 8.65.
@vtemian
vtemian merged commit eb90f04 into vtemian:main Jul 30, 2026
2 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.

Bug: steps from opencode.json agent config silently discarded during agent merge

2 participants