piker/ai/prompt-io/opencode/20261028T165638Z_b95e7c79_r...

71 lines
2.8 KiB
Markdown
Raw Normal View History

.data: expose websocket reconnect progress at INFO An INFO pikerd still hid websocket connection-success messages. The shared ._util.log emitter is piker.data, but open_feed_bus() configured piker.data.feed. Errors reached bare stderr while INFO diagnostics remained disabled on the actual emitter. Configure the shared logger by its exact log.name and prefer the actor's loglevel over a quieter per-client request for these actor-wide transport diagnostics. Preserve the selected client level passed to provider feed startup. Also, - retain the existing handshake-success report and add URL-tagged readiness after fixture setup and first-message relay once per connection, including replacement sockets. - include the URL in receive-timeout reset errors so Binance's independent bookTicker and aggTrade routes are distinguishable. - prove real console INFO visibility through production feed startup, stopping before provider lookup, then restore logging state; the original code fails with the emitter at WARNING. - extend the loopback recovery test to verify both readiness reports and the first relay from the replacement connection. First-message relay is raw websocket traffic, not proof that parsed market data or chart updates have recovered. The 18 logging/Binance/websocket cases pass; live reporting qualification remains separate. This is a local follow-up, not a downstream cherry-pick. The 54da2973 websocket cleanup and 5adf77a9 namespace fix do not configure this shared emitter. Relevant local histories and dirty IB-history/TIPC deltas contain no equivalent wiring fix. Prompt-IO: ai/prompt-io/opencode/20261028T165638Z_b95e7c79_reconnect_logging.md (this patch was generated in some part by `opencode` using `gpt-6.1-sol` (`openai`))
2026-10-28 17:13:26 +00:00
---
created_at: 2026-10-28T16:56:38Z
generated_by:
harness: opencode
provider: openai
model: openai/gpt-6.1-sol
git_ref: b95e7c79
scope: code
substantive: true
raw_file: 20261028T165638Z_b95e7c79_reconnect_logging.raw.md
---
## Prompt
The human reported that the live Binance Pong-in-LOCAL_CLOSING
error now logged a retry without crashing. They requested visible
re-establishment reporting under `pikerd -l info --pdb`, and asked
to check for existing downstream work before adding a fix.
## Response summary
The existing `Connection success` INFO message already identifies
handshake completion. Feed startup configured piker.data.feed,
while shared websocket diagnostics use ._util.log on piker.data.
Configure that actual emitter and prefer the daemon's verbosity
over a quieter client request for these shared transport tasks.
Add a readiness INFO message after fixture setup and a first-message
INFO report once per connection after actual relay. Include the URL
in the receive-timeout reset error. Do not call first raw websocket
traffic a parsed quote or proof of restored market-data freshness.
## Existing-work audit
Compared `_web_bs.py`, `_util.py`, `piker.log` and daemon logging
against the evaluated downstream tip and relevant all-ref histories.
`54da2973` contains logging/type cleanup, not this emitter fix.
`5adf77a9` / landing equivalents address package-name correctness,
but not configuration of the shared data emitter at feed startup.
All-ref searches for this actual emitter/readiness/first-relay
implementation found no existing commit. The dirty IB history
worktree has only an unrelated f-string correction in `_web_bs.py`;
the TIPC worktree has no dirty delta in these two feed/websocket
files. No downstream work was overwritten or imported wholesale.
## Files changed
- `piker/data/feed.py`: shared transport logger startup/verbosity.
- `piker/data/_web_bs.py`: readiness, first-relay and timeout URL.
- `tests/test_logging.py`: actual emitter/console startup regression.
- `tests/test_websocket.py`: recovery milestones on real loopback.
- This prompt provenance pair.
## Verification
The new logging regression against original b95e7c79 source fails:
the actual websocket emitter remains at WARNING and rejects INFO.
It passes with the logger wiring fix. Provider lookup is stopped
before network work, while logger factories and console emission
are real. Global logger state is restored after the check.
18 cases pass across tests/test_logging.py, tests/test_websocket.py
and tests/test_binance.py. git diff --check passes. Live verification
after restarting the daemon with these edits remains human-owned.
## Human edits
No direct manual source edits observed. The human supplied live
recovery evidence, selected INFO verbosity, requested downstream
reuse inspection, and retains live-test and commit ownership.