Skip to content

Log lines carry their own session, never the last one the thread served (#1008) - #1011

Queued
aft-alfonso[bot] wants to merge 4 commits into
mainfrom
land/log-session-prefix
Queued

aft-alfonso[bot] wants to merge 4 commits into
mainfrom
land/log-session-prefix

Conversation

@aft-alfonso

@aft-alfonso aft-alfonso Bot commented Oct 26, 2026

Copy link
Copy Markdown

Fixes #1008. The slow-bind warning on the frame loop was tagged with whatever session that thread served last, because unscoped log lines fell back to LAST_SESSION. In the subc daemon one thread serves many sessions in turn, so that fallback sent operators to the wrong session.

  • The pending-bind warning now logs inside the bind's own session scope (the session is stored on the pending bind), or untagged when the bind has none.
  • The LAST_SESSION fallback is removed: a line logged outside any session scope carries no session tag. Its original rationale (one session per project) no longer holds.
  • Tests: after a thread serves session A, a warning for session B's bind carries [ses_B] and a session-less bind's warning carries no tag, and no line carries A; unscoped lines after a scope ends are untagged.

ualtinok and others added 4 commits October 27, 2026 00:04
…ion log fallback (#1008)

The slow-bind warning ran on the frame loop outside any session scope and
log_ctx fell back to LAST_SESSION, the last session that thread served, so
operators were sent to an unrelated session. PendingBind now records the
requesting session and the warning logs inside that session's scope.

The LAST_SESSION fallback (8781458) existed only to avoid untagged
watcher/gitignore lines on the assumption of one session per project. On
threads that serve many sessions (request loop, frame loop, executor
workers) it mislabels every unscoped line, and nothing depends on it: the
CLI log readers already handle untagged lines. It is removed, so unscoped
lines carry no session tag.

Tests that asserted the fallback (session_prefix_format,
set_session_direct, the falls-back/updates/none-does-not-clear tests and
the integration slog_macros_prepend_session_tag case 2) are rewritten to
the new contract on purpose: an unscoped line carries no session.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
(cherry picked from commit 040014761aeb857a7181bbd3d09f3b3c726081ed)
#1008)

The stuck-pending-watch scan, the scope-workdir comparison and three
bash handoff/deadline warnings run on shared subc runtime or blocking-pool
threads outside any session scope but each concerns one known session.
Log each inside that session's scope so it carries the right tag instead
of none.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
(cherry picked from commit 446bfd98451dececbf84805f1268cc4f340843cb)
scope_workdir_mismatch_logs_once_and_preserves_project_root pins this line
as untagged and its body already names the session. With the last-session
fallback removed it can no longer carry a wrong session, so the wrap from
the previous commit is reverted rather than changing that test.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
(cherry picked from commit 0258b9505df5cdb6f2838376c7f7da0702f27892)
…note

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
@ualtinok
ualtinok added this pull request to the merge queue Oct 26, 2026
Any commits made after this event will not be merged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slow-bind warning shows the previous session's id, not the bind's session

1 participant