Skip to content

fix(core): reload config after create_rule_block so the new rule applies immediately#12920

Open
houssemzaier wants to merge 1 commit into
continuedev:mainfrom
houssemzaier:fix/reload-config-after-create-rule-block
Open

fix(core): reload config after create_rule_block so the new rule applies immediately#12920
houssemzaier wants to merge 1 commit into
continuedev:mainfrom
houssemzaier:fix/reload-config-after-create-rule-block

Conversation

@houssemzaier

@houssemzaier houssemzaier commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Description

When the model creates a rule with the create_rule_block tool, the rule file is written via ide.writeFile(), which doesn't trigger VS Code's workspace file-change events. So the new rule isn't picked up until the next manual config reload — the user has to reload (or restart) before the rule they just asked for actually applies.

After the create_rule_block tool runs successfully, this PR invalidates the walkDir cache and reloads the config, so the freshly-created rule takes effect immediately.

It's a small, targeted change in the tool-call handler (core/core.ts): only the create_rule_block tool triggers the reload, and only when it didn't error (!result.errorMessage).

We've been running this in a downstream fork (3,000+ users) and it's been stable.

Tests

Manual: ask the assistant to create a rule (via the create_rule_block tool), then immediately rely on it — the rule now applies without a manual reload.

Checklist

  • I've read the contributing guide
  • Tests — n/a (a small behavioral fix in the tool-call handler; verified manually)
  • Docs — n/a

Summary by cubic

Hot-reloads the config after a successful create_rule_block so the new rule applies immediately without a manual reload. This invalidates the walkDir cache and reloads the config in the tool-call handler.

  • Bug Fixes
    • Works around ide.writeFile() not emitting VS Code workspace events by reloading only for create_rule_block and only on success.

Written for commit a1cceef. Summary will update on new commits.

Review in cubic

…ies immediately

When the `create_rule_block` tool creates a rule, it writes the file via
`ide.writeFile()`, which does not trigger VS Code workspace file events — so the
new rule is not picked up until the next manual config reload. After the tool
runs successfully we now invalidate the walkDir cache and reload the config, so
the rule the model just created takes effect right away.
@houssemzaier houssemzaier requested a review from a team as a code owner June 30, 2026 00:32
@houssemzaier houssemzaier requested review from sestinj and removed request for a team June 30, 2026 00:32
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jun 30, 2026

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 1 file

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant