[#319] 🐛 - Setup crash on repository with no issues#320
Conversation
…bel fetching error handling and add new documentation files for agent context.
…S constant and replace the 'initial_setup' string literal with `ACTIONS.INITIAL_SETUP`.
…_AGENT_PLAN` constant to 'build' to enable diff support.
|
To view this pull requests documentation preview, visit the following URL: Documentation is deployed and generated using docs.page. |
🐛 Bugfix Actions
Debug log🚀 Happy coding! Made with ❤️ by vypdev/copilot |
|
|
||
| /** Default OpenCode agent for analysis/planning (read-only, no file edits). */ | ||
| export const OPENCODE_AGENT_PLAN = 'plan'; | ||
| /** Default OpenCode agent for analysis/planning (read-only, no file edits). Changed to build to support diffs. */ |
There was a problem hiding this comment.
Duplicated OpenCode agent constants
Severity: high
Location: src/data/repository/ai_repository.ts:233
OPENCODE_AGENT_PLAN and OPENCODE_AGENT_BUILD both have the value 'build'. This duplication can be confusing and may lead to misconfiguration or incorrect agent usage in code paths that rely on these two constants to denote different roles.
Suggested fix:
Consolidate or clearly differentiate PLAN and BUILD agent identifiers, and update references accordingly. Consider adding a short comment clarifying intended distinction.
Written by vypdev/copilot for commit 89b267bd54a6224cbaca6bd566df2652c1ccb858. This will update automatically on new commits.
There was a problem hiding this comment.
Yes, the constant values for the two agent modes have been duplicated, and both currently include the build parameter/value.
This will remain as-is for testing purposes. Some models are able to compute differences between branches using plan mode, while others — for example, certain GPT models — seem to only compute branch differences correctly when using build mode rather than plan.
We’ll keep this setup in order to test different models and compare their behavior.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #320 +/- ##
===========================================
+ Coverage 88.82% 90.86% +2.04%
===========================================
Files 134 135 +1
Lines 5941 6198 +257
Branches 1272 1329 +57
===========================================
+ Hits 5277 5632 +355
+ Misses 250 171 -79
+ Partials 414 395 -19
🚀 New features to boost your workflow:
|
…ndling and test coverage for label and issue type related operations.
…extraction and update logic for issue descriptions, default `parentBranch` in execution, and remove `results` from configuration.
…t branch if unset and improve content parsing robustness by using exact pattern matching and substring operations.
… extraction and update logic to use `indexOf` with a starting offset for end tags, removing the custom `findExactMatch` method.
…block index calculation into a new private helper method.
…ation merging to preserve all undefined stored keys and prevent saving results, adding robustness tests.
| @@ -344,12 +344,21 @@ export class IssueRepository { | |||
| return []; | |||
There was a problem hiding this comment.
Silent error suppression in getLabels for non-404 errors
Severity: high
Location: src/data/repository/issue_repository.ts:0
getLabels swallows non-404 errors and returns an empty label set, masking connectivity or server issues that should surface to callers.
Suggested fix:
Refine error handling: treat 404 as a known edge case returning [] but propagate non-404 errors (log a warning) so upstream code can respond appropriately.
Written by vypdev/copilot for commit 255f150d219b94c9c26832f354ba6e1a41626b62. This will update automatically on new commits.
| @@ -4,9 +4,9 @@ import { ConfigurationHandler } from "../../manager/description/configuration_ha | |||
| import { GetHotfixVersionUseCase } from "../../usecase/steps/common/get_hotfix_version_use_case"; | |||
There was a problem hiding this comment.
Conditional label fetch in setup may obscure edge cases
Severity: low
Location: src/data/model/execution.ts:0
Execution.setup guards label fetching with a broad try/catch that only explicitly accommodates INITIAL_SETUP; other initialization paths may skip label retrieval, causing inconsistent behavior.
Suggested fix:
Make the guard explicit (e.g., via a centralized shouldSkipInitialLabelFetch()) and add tests for alternate init paths to ensure consistent label handling.
Written by vypdev/copilot for commit 255f150d219b94c9c26832f354ba6e1a41626b62. This will update automatically on new commits.
| @@ -230,8 +230,8 @@ function logPartsForDebug(parts: unknown[], context: string): void { | |||
| }); | |||
There was a problem hiding this comment.
OPENCODE_AGENT_PLAN constant changed
Severity: medium
Location: src/data/repository/ai_repository.ts:233
OPENCODE_AGENT_PLAN appears to have shifted from the expected value ('plan') to 'build', which may disrupt the planning workflow and downstream consumers.
Suggested fix:
Confirm the intended constant value; if the change is deliberate, document the rationale and ensure all references align; update tests accordingly.
Written by vypdev/copilot for commit 255f150d219b94c9c26832f354ba6e1a41626b62. This will update automatically on new commits.
…ocumentation by moving use case flows to a dedicated file and enhancing Bugbot details with key paths and configuration.
… branch from previous configuration when current is undefined.
🐛 Bugfix Actions
Debug log🚀 Happy coding! Made with ❤️ by vypdev/copilot |


Summary
The setup command no longer crashes on repositories that have no issues. It now gracefully handles 404 Not Found when attempting to fetch labels for issue #1 and continues with the setup flow using safe defaults.
Related Issues
Scope of Changes
Technical Details
How to Test
Test Coverage / Deployment / Security / Performance / Checklist
Breaking Changes
None
Notes for Reviewers / Additional Context
This change is narrowly scoped to the issue label retrieval path during setup and does not affect user workflows beyond preventing a crash in edge cases. If there are other edge cases around repository state (e.g., archived issues, private repos), we can extend the same 404-safe pattern to those paths.