Agent hint for `gh event listen`: add an opt-out, and show it only when the caller polls
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 46/100
Rechercherichtung
Start by tracing where gh prints the agent hint for API and pull request reads, then check how GH_NO_UPDATE_NOTIFIER is defined and documented in gh help environment. The issue proposes an opt-out, polling-aware display, and a shorter hint, but does not name the relevant files or tests; identify those entry points and existing tests first. Done means the hint can be disabled and is limited to polling use, with coverage for the chosen behavior.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Describe the feature or problem you'd like to solve
Since 2.105.0 (#15077), gh api repos/O/R/pulls/N/..., gh pr view and gh pr create print a nine-line gh event listen hint on stderr whenever an agent is detected. Nothing turns it off: gh help environment and gh config have no key for it, so the only escape is to unset AI_AGENT, CLAUDECODE and friends for every gh call, which also removes the agent from the User-Agent.
We don't poll. Our agents wait on pull requests through a self-hosted service (below), and they call gh api .../pulls/N/comments or gh pr view for one-off reads: listing unanswered review threads, fetching a comment id to reply to, checking a field. Every one of those reads now carries the hint. An agent's stderr goes straight into its context window, where it stays and is re-read on each later model call until the context is compacted.
Measured from our Claude Code transcripts between installing 2.105.0 (2026-11-18 10:54 UTC) and 2026-11-20 07:50 UTC, about 45 hours:
| Transcripts containing the hint | 38 (9 sessions and their subagents) |
| Hints printed | 162 |
| One hint | ~810 characters, ~195 tokens |
| Tokens added to context | ~32,000 |
| Tokens re-read by later model calls before compaction | ~8.0 million |
The five sessions with the most hints, each counted with its subagents:
| Session | Hints | Tokens added | Tokens re-read |
|---|---|---|---|
| A | 62 | 12,300 | 2.6M |
| B | 51 | 10,100 | 3.5M |
| C | 26 | 5,100 | 1.0M |
| D | 8 | 1,600 | 0.34M |
| E | 6 | 1,200 | 0.15M |
Method: each hint's length times the number of distinct model requests after it in the same transcript, up to the next compaction. Token counts use o200k_base as a stand-in tokenizer. Most re-reads are prompt-cache hits, so the bigger costs are context-window room and earlier compaction.
Proposed solution
- An opt-out, in the style of
GH_NO_UPDATE_NOTIFIER: for exampleGH_NO_AGENT_HINTS=1orgh config set agent_hints disabled, listed ingh help environment. - Show the hint for polling, not for the first read. Print it only when the same pull request has been read several times within a few minutes, or at most once per pull request per day, using the cache directory to remember. A single
GETof/pulls/N/commentsis not a wait loop. - Make it one line, such as
hint: to wait for this pull request, see gh event listen --help. The details are already in that help text.
Additional context
We wait on pull requests through our own watcher rather than gh event listen. What the Events API would need for us to switch is platform feedback, so it is in the Event Streams preview discussion (https://github.com/orgs/community/discussions/211595), not here. This issue is only about the hint gh prints.
- Vorherrschende Sprache
- Go
- Sterne
- 47.4k
- Forks
- 9.5k
- Ø Merge
- 18 Std. 34 Min.
- Gemergte PRs (30 T.)
- 70
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus cli/cli
-
`gh search prs --locked=false` silently ignores the requested search filterEvtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offenbug gh-search priority-3
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
cli/cli#15188 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
`gh run watch` drops annotations for jobs that are queued on the first pollEvtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offenbug gh-run priority-3
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
Maintainer antworten meist innerhalb von 1 Tag
-
gh skill update reports success when a repository cannot be resolvedEvtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offenbug gh-skill priority-3
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
cli/cli#15092 · 4 Kommentare · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
`gh label list --json` prints nothing instead of `[]` when the repository has no labelsEvtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offenblocked bug gh-label needs-investigation priority-3
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
cli/cli#15066 · 4 Kommentare · 2 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag
-
`gh search code '"term"'` sends the typed quotes escaped (`q="\"term\""`) and finds nothingEvtl. wieder frei @Daiyuanranfeng hat das vor 17 Tagen übernommen, und es ist kein Pull Request offen. Offenauto-bugfix-fixing bug gh-search priority-3
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
cli/cli#15060 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Ähnliche Issues
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
seriousm4x/UpSnap#1786 ·
-
bug feedback ui/ux
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
peasant-labs/peasant#1307 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Reformat test names for single-protocol tests to start with Protocol/, i.e. gRPC/ or Websocket/Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
connectrpc/conformance#1211 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug effort:s impact:med raised-by:desk risk:low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
medici-finance/assay#8342 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
hardening
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
inference-sim/inference-sim#2821 ·
Maintainer antworten meist innerhalb von 1 Tag