Skip to content

[deep-report] Replace brittle strings.Contains(err.Error()) checks with structured errorutil helpers #54315

Closed

Description

@github-actions

Description

The Error Handling Consistency & Panic Safety report (discussion #54241, 2026-08-20) found 3 brittle strings.Contains(err.Error(), "...") checks outside test/linter fixtures that would break silently if the wrapped CLI's error text changes: pkg/cli/project_command.go:385 (INSUFFICIENT_SCOPES), pkg/cli/update_extension_check.go:439, and pkg/cli/add_interactive_git.go:22 (already merged/MERGED). Verified all three sites exist. Only add_interactive_git.go documents the exception with a nolint-style justification for the project's own errstringmatch linter convention; the other two are unflagged/inconsistent.

Expected Impact

Removes a class of silent breakage risk (wrapped CLI changing its error text drops these checks with no compile-time or lint signal) and brings all three sites in line with the project's existing errstringmatch linter convention.

Suggested Agent

New Agent — add structured error-detection helpers to pkg/cli/errorutil (e.g., typed sentinel errors or exit-code/JSON-based checks where the wrapped CLI supports them) and replace the two unflagged string-matching sites; add a nolint-style justification comment to any that remain string-based by necessity.

Estimated Effort

Medium (1-4 hours)

Data Source

DeepReport Intelligence Briefing analysis of discussion #54241 (Repository Quality Improvement Report - Error Handling Consistency & Panic Safety, 2026-08-20).

Generated by 🔬 Deep Report · agent · 163.9 AIC · ⌖ 8.4 AIC · ⊞ 11.9K · ◷

  • expires on Aug 22, 2026, 10:32 AM UTC-08:00

Activity

  1. github-actions commented on Aug 21, 2026

    @github-actions
    ContributorAuthor

    🍪 Issue Monster selected this for Copilot

    I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.

    If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.

    Om nom nom! 🍪

    🍪 Om nom nom by Issue Monster · gpt54 · 3.58 AIC · ⌖ 10.2 AIC · ⊞ 12.5K · ◷

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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions