Agent hint for `gh event listen`: add an opt-out, and show it only when the caller polls
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 46/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Go
- Étoiles
- 47.4k
- Forks
- 9.5k
- Merge moyen
- 18 h 34 min
- PR mergées (30 j)
- 70
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de cli/cli
-
`gh search prs --locked=false` silently ignores the requested search filterPeut-être à nouveau libre Une pull request pour cette issue a été fermée sans être fusionnée. Ouvertebug gh-search priority-3
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
cli/cli#15188 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
`gh run watch` drops annotations for jobs that are queued on the first pollPeut-être à nouveau libre Une pull request pour cette issue a été fermée sans être fusionnée. Ouvertebug gh-run priority-3
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
cli/cli#15186 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
gh skill update reports success when a repository cannot be resolvedPeut-être à nouveau libre Une pull request pour cette issue a été fermée sans être fusionnée. Ouvertebug gh-skill priority-3
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
cli/cli#15092 · 4 commentaires · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
-
`gh label list --json` prints nothing instead of `[]` when the repository has no labelsPeut-être à nouveau libre Une pull request pour cette issue a été fermée sans être fusionnée. Ouverteblocked bug gh-label needs-investigation priority-3
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
cli/cli#15066 · 4 commentaires · 2 réactions ·
Les mainteneurs répondent en général sous 1 jour
-
`gh search code '"term"'` sends the typed quotes escaped (`q="\"term\""`) and finds nothingPeut-être à nouveau libre @Daiyuanranfeng l’a pris il y a 17 jours, et aucune pull request n’est ouverte. Ouverteauto-bugfix-fixing bug gh-search priority-3
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
cli/cli#15060 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
Issues similaires
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
seriousm4x/UpSnap#1786 ·
-
bug feedback ui/ux
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
peasant-labs/peasant#1307 ·
Les mainteneurs répondent en général sous 1 jour
-
Reformat test names for single-protocol tests to start with Protocol/, i.e. gRPC/ or Websocket/Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
connectrpc/conformance#1211 ·
Les mainteneurs répondent en général sous 1 jour
-
bug effort:s impact:med raised-by:desk risk:low
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
medici-finance/assay#8342 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
hardening
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
inference-sim/inference-sim#2821 ·
Les mainteneurs répondent en général sous 1 jour