Skip to content

first run: a 'media: … passing over it' log line is left in the terminal #1740

Open

Description

@AbirAbbas

What happened

Found on 2026-10-02 during the pre-staging happy-path pass on dev 06a3283dd. The emitting code is the same in v0.6.0 (61da16199).

On a brand-new profile with no key, a stray standard-logger line is printed to the terminal. It is written before the chat surface redirects the logger, so it sits under the alternate screen and is left in the shell's scrollback once codeaf exits:

2026/10/02 16:08:00 media: the vision fallback names google/gemini-3.7-flash, which cannot see — passing over it

It also appears on the installer's automatic first start (curl -fsSL https://agentfield.ai/get/devaf | bash, then the guided launch). getting-started.md describes the first-run setup as having nothing else on the frame. A person's first codeaf session should not leave a raw diagnostic in their terminal.

Replication

Deterministic (no model call). HOME=$(mktemp -d) CODEAF_HOME=$(mktemp -d) CODEAF_TELEMETRY=off bin/codeaf in any folder, with no key in the environment. When the connect step appears, press esc and then ctrl+c. Today the scrollback shows the media: … passing over it line above the exit. Whether it fires depends on the catalog's current vision fallback, so a fixture catalog whose fallback lacks image input reproduces it without the network.

Where

cmd/codeaf/chatv3_media.go: search passing over it. It uses the package log when the resolver rejects a candidate. cmd/codeaf/chatv3.go wires that resolver before runSurface, and the terminal logger is only redirected inside cmd/codeaf/chatv3_surface.go. firstrun_quiet_test.go (TestAFirstLaunchWithNoKeyLeavesMediaAbsentWithoutALine) pins silence for the media client, not for the resolver.

The fix

Nothing reaches the terminal before or around the surface. The resolver's note goes to the chat log (or is silent), the same as every other diagnostic after the redirect.

Acceptance

  • e2e: a fresh-profile, no-key launch with a fixture catalog whose vision fallback cannot see, then esc and ctrl+c: the captured terminal output contains no media: line, and the exit code is 0.
  • Unit: the resolver's rejection path writes through the chat-log logger rather than the package log, or a structural law fails any log.Print* reachable before the surface's redirect.

Activity

  1. added
    bug
    area:chat
    area:logging
    on Oct 3, 2026
  2. added
    sev:papercut
    on Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:chatarea:loggingbugsev:papercut

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions