Второй пилот CLI может открыть GitHub проблемы с терминала. Вместо того чтобы переключаться в браузер и вручную заполнять задачу, вы описываете, что вам нужно, и Copilot собирает контекст из вашего репозитория и GitHub, а затем создаёт проблему, чтобы вы могли продолжать работать.
Пример сценария 1: Подача проблемы из-за отказа CI
Ваш CI не работает или вы заметили ошибки в производственных журналах. Вместо того чтобы вручную отслеживать стек до коммита, вы просите Второй пилот CLI расследовать и зарегистрировать проблему за вас.
Пример запроса
The CI workflow on main has been failing since yesterday. Look at the failing run, figure out what's breaking and which commit likely introduced it, then create an issue with the stack trace, a link to the failing run, and the suspected PR that caused it. Label it "bug" and "regression".
The CI workflow on main has been failing since yesterday. Look at the failing
run, figure out what's breaking and which commit likely introduced it, then
create an issue with the stack trace, a link to the failing run, and the
suspected PR that caused it. Label it "bug" and "regression".
Пример ответа
Примечание.
Следующий ответ является примером. Ответы Копилот Чат являются недетерминированными, поэтому вы можете получить другой ответ, показанный здесь.
Второй пилот CLI использует свои GitHub инструменты MCP для:
-
Получите неудачный рабочий процесс, запустите и извлечьте трассировку стека из логов.
-
Определите ответственный код — например,
src/services/payment.ts:94. -
Найдите недавние коммиты , касающиеся этого файла, и найдите PR, который внёс изменение.
-
Создайте проблему со всем собранным контекстом:
Created issue #421: Regression: PaymentService throws TypeError after #398 What's failing: The `build` job on main has failed since commit `a3f7c21`. Stack trace: TypeError: Cannot read properties of undefined (reading 'amount') at processRefund (src/services/payment.ts:94:22) Introduced by: PR #398 (merged 2 days ago) refactored the payment types but missed updating `processRefund` to handle the new nullable `transaction` field. Failing run: Actions run #2847 Suggested fix: Add a null check for `transaction` before accessing `transaction.amount` on line 94. Labels: `bug`, `regression`
Пример сценария 2: Преобразование TODO в отслеживаемую работу
Со временем комментарии TODO и FIXME накапливаются в кодовой базе без видимости. Вы можете попросить Второй пилот CLI отсканировать эти комментарии, оценить приоритет и создать проблемы, чтобы работа отслеживалась.
Пример запроса
Scan this repo for TODO and FIXME comments. Group them by area, pick the 5 most important ones based on the surrounding code context, and create an issue for each. Include the code snippet, file location, and suggest a label.
Scan this repo for TODO and FIXME comments. Group them by area, pick the 5
most important ones based on the surrounding code context, and create an issue
for each. Include the code snippet, file location, and suggest a label.
Пример ответа
Примечание.
Следующий ответ является примером. Ответы Копилот Чат являются недетерминированными, поэтому вы можете получить другой ответ, показанный здесь.
Второй пилот CLI Ищет по коду, читает контекст каждого комментария и расставляет приоритеты по степени серьёзности:
Found 23 TODO/FIXME comments across the repo. Here are the 5 I'd prioritize:
Created issue #422: FIXME: SQL injection risk in search query builder
- src/db/search.ts:34 — user input concatenated directly into query string
- Label: security, priority:high
Created issue #423: TODO: Rate limiter bypassed for internal routes
- src/middleware/rate_limit.ts:12 — comment says "temporary bypass, remove before launch"
- Label: security, technical-debt
Created issue #424: FIXME: Memory leak in WebSocket handler
- src/ws/handler.ts:87 — listeners are added on each connection but never cleaned up
- Label: bug, performance
Created issue #425: TODO: Retry logic missing for payment webhook
- src/webhooks/payment.ts:56 — failures silently dropped, no retry queue
- Label: reliability, priority:medium
Created issue #426: TODO: Migrate to new auth token format
- src/auth/token.ts:3 — comment references a closing down API version
- Label: technical-debt