Skip to content

fix(agent-core): route session logs exclusively to session sink - #102

Merged
kermanx merged 1 commit into
mainfrom
fix/session-log-routing
May 27, 2026
Merged

fix(agent-core): route session logs exclusively to session sink#102
kermanx merged 1 commit into
mainfrom
fix/session-log-routing

Conversation

@kermanx

@kermanx kermanx commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Related Issue

No related issue.

Problem

Session-tagged log entries were previously written to both the global log sink and the session-specific sink, causing duplication in global logs. Additionally, context key omission for stable main-agent fields (sessionId, agentId) was only applied to llm request messages, leaving other main-agent session lines with redundant context fields.

What changed

  • RootLoggerImpl.emit now routes session-tagged entries exclusively to the resolved session sink. Non-session entries continue to go to the global sink, eliminating duplication.
  • llmRequestSessionLogOmittedKeys is now invoked for every session entry, consistently omitting stable main-agent context keys from all session lines rather than only llm request lines.
  • Updated test expectations in logger.test.ts to match the new routing and omission behavior.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented May 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ec4afbd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@moonshot-ai/agent-core Patch
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

- Session-tagged entries no longer duplicate into the global sink.
- Stable main-agent context key omission now applies to all session
  lines with agentId=main, not only 'llm request'.
- Update test expectations to match the new routing behavior.
@kermanx
kermanx force-pushed the fix/session-log-routing branch from 8d6f4cb to ec4afbd Compare May 27, 2026 04:50
@kermanx
kermanx merged commit 6f55f1d into main May 27, 2026
4 checks passed
@kermanx
kermanx deleted the fix/session-log-routing branch May 27, 2026 05:00
@github-actions github-actions Bot mentioned this pull request May 27, 2026
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.

1 participant