Skip to content

Docs: Add 'fix at source' anti-pattern to IssueFixAgent#5598

Merged
kirankumarkolli merged 2 commits intomasterfrom
users/kirankk/copilot-agent-plan-fix-at-source
Feb 2, 2026
Merged

Docs: Add 'fix at source' anti-pattern to IssueFixAgent#5598
kirankumarkolli merged 2 commits intomasterfrom
users/kirankk/copilot-agent-plan-fix-at-source

Conversation

@kirankumarkolli
Copy link
Copy Markdown
Member

Description

Adds guidance to the IssueFixAgent plan about fixing bugs at the source of invalid state rather than adding defensive checks at callers.

New Anti-Pattern Added

  • Bad: Add null check at caller when source method returns null incorrectly
  • Good: Fix at source of truth - throw exception where invalid state originates
  • Rule: ALWAYS fix bugs at the source where invalid state originates

Why This Matters

  • Provides clear error messages at the source
  • Prevents the same bug pattern in other callers
  • Keeps error handling centralized

Learned From

Issue #5596 investigation - the fix was to add isDisposed check in GetStoreProxy() rather than improving the null check in TransportHandler.


Generated by GitHub Copilot CLI Agent

Adds guidance to fix bugs at the source of invalid state rather than
adding defensive checks at callers. This ensures:
- Clear error messages at the source
- Prevents same bug pattern in other callers
- Keeps error handling centralized
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Please follow the required format: "[Internal] Category: (Adds|Fixes|Refactors|Removes) Description"

Internal should be used for PRs that have no customer impact. This flag is used to help generate the changelog to know which PRs should be included. Examples:
Diagnostics: Adds GetElapsedClientLatency to CosmosDiagnostics
PartitionKey: Fixes null reference when using default(PartitionKey)
[v4] Client Encryption: Refactors code to external project
[Internal] Query: Adds code generator for CosmosNumbers for easy additions in the future.

Adds an audit checklist to the PR description template to ensure
all IssueFixAgent workflow checkpoints are followed:
- Pre-branch search for existing PRs/branches
- Local build and test validation
- Root cause documentation
- Investigation steps in PR body
- Issue comment posted
@kirankumarkolli kirankumarkolli marked this pull request as ready for review February 2, 2026 18:50
@kirankumarkolli kirankumarkolli merged commit bf1325a into master Feb 2, 2026
7 checks passed
@kirankumarkolli kirankumarkolli deleted the users/kirankk/copilot-agent-plan-fix-at-source branch February 2, 2026 18:50
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