Skip to content

fix(opencode): /compact works when default_agent is a subagent (fixes #29277)#29370

Open
levgiorg wants to merge 1 commit into
anomalyco:devfrom
levgiorg:fix/issue-29277-compact-subagent
Open

fix(opencode): /compact works when default_agent is a subagent (fixes #29277)#29370
levgiorg wants to merge 1 commit into
anomalyco:devfrom
levgiorg:fix/issue-29277-compact-subagent

Conversation

@levgiorg
Copy link
Copy Markdown

Issue for this PR

Closes #29277

Type of change

  • Bug fix

What does this PR do?

Fix /compact command to work when default_agent is a subagent by deferring the defaultAgent() lookup.

How did you verify your code works?

  • TypeScript typecheck passes
  • Existing tests pass

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

…gent error

The /compact command failed silently when default_agent was a subagent because agentSvc.defaultAgent() threw before checking if messages already specified a valid agent. Deferred the lookup so it only runs when needed.

Fixes anomalyco#29277
@github-actions
Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicate Found

PR #29276 - fix(session): defer defaultAgent lookup in summarize handler so compaction works with subagent-only configs
#29276

This PR appears to be closely related to the current PR #29370. Both address the same issue (#29277) by deferring defaultAgent() lookup to make the /compact command work with subagent-only configurations. They likely implement the same or very similar fixes in different locations or represent duplicate work on the same problem.

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.

/compact command silently fails when default_agent is a subagent

1 participant