Skip to content

memory: install tools before conflict gate so partial harness conflicts cannot block provisioning - #144

Merged
yourconscience merged 1 commit into
mainfrom
memory/install-before-conflicts
Aug 22, 2026
Merged

memory: install tools before conflict gate so partial harness conflicts cannot block provisioning#144
yourconscience merged 1 commit into
mainfrom
memory/install-before-conflicts

Conversation

@yourconscience

@yourconscience yourconscience commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Summary by Sourcery

Bug Fixes:

  • Install memory tools before evaluating repository skill conflicts so partial harness conflicts do not prevent required provisioning.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@sourcery-ai

sourcery-ai Bot commented Aug 22, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The PR adjusts the sync flow so memory tools are installed earlier, before the skills/conflict gating, ensuring partial harness conflicts do not block tool provisioning, while keeping behavior and logging identical otherwise.

Flow diagram for memory tool installation before conflict gating

flowchart TD
    A[runSync] --> B[installMemoryTools]
    B --> C{Installation error?}
    C -->|Yes| D[Return error]
    C -->|No| E[expectedSkills]
    E --> F{Skills or harness conflict?}
    F -->|Yes| G[Return conflict error]
    F -->|No| H[Continue sync]
    B --> I[Log installed tools]
Loading

File-Level Changes

Change Details Files
Install memory tools earlier in the sync flow, before expected skills are computed and conflict gating runs.
  • Move the installMemoryTools(repoRoot) invocation from later in runSync to immediately after repo inspection succeeds
  • Preserve error handling by returning early on installMemoryTools failure as before
  • Retain existing logging of installed memory tools using the same fmt.Printf and strings.Join behavior
cmd/dotagents/sync.go

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@yourconscience
yourconscience merged commit d780591 into main Aug 22, 2026
5 checks passed
@yourconscience
yourconscience deleted the memory/install-before-conflicts branch August 22, 2026 20:55

@sourcery-ai sourcery-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.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="cmd/dotagents/sync.go" line_range="74" />
<code_context>
 		return err
 	}

+	toolInstalls, err := installMemoryTools(repoRoot)
+	if err != nil {
+		return err
</code_context>
<issue_to_address>
**nitpick:** The `installMemoryTools` comment says provisioning occurs after files are reconciled, but this invocation now runs before agent conflicts are checked and before any agent synchronization is applied. The comment therefore misstates the operation order and can mislead callers about whether a failed sync has already provisioned tools.

**Suggested fix:** Update the comment to describe that tools are installed after repository artifacts are rendered but before agent conflict validation and reconciliation.

```suggestion
	// Install tools after repository artifacts are rendered but before agent conflict validation and reconciliation.
	toolInstalls, err := installMemoryTools(repoRoot)
```
</issue_to_address>

Sourcery assessment

Needs a human reviewer. If the new ordering is wrong, a sync that later fails the conflict check can still install memory tools and leave those changes on disk after the code is reverted. The impact is bounded and can be repaired by removing or reinstalling the tools, but reverting the PR does not undo the provisioning side effect.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread cmd/dotagents/sync.go
return err
}

toolInstalls, err := installMemoryTools(repoRoot)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nitpick: The installMemoryTools comment says provisioning occurs after files are reconciled, but this invocation now runs before agent conflicts are checked and before any agent synchronization is applied. The comment therefore misstates the operation order and can mislead callers about whether a failed sync has already provisioned tools.

Suggested fix: Update the comment to describe that tools are installed after repository artifacts are rendered but before agent conflict validation and reconciliation.

Suggested change
toolInstalls, err := installMemoryTools(repoRoot)
// Install tools after repository artifacts are rendered but before agent conflict validation and reconciliation.
toolInstalls, err := installMemoryTools(repoRoot)

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