Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement notifications handling for extension logs #1415

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lily-de
Copy link
Collaborator

@lily-de lily-de commented Feb 27, 2025

This will allow developers to view logs from their extensions (servers). For the MCP protocol, logs are emitted as notification-type messages, so this PR expands how we handle server responses to include notifications.

@lily-de lily-de changed the title feat: implement notifications handling for logs feat: implement notifications handling for extension logs Feb 27, 2025
@salman1993
Copy link
Collaborator

salman1993 commented Feb 27, 2025

This is great - lots of people asking about this will help a lot. A couple thoughts:

  • we have the MCP rusk-sdk repo now (not sure when we plan to start using that repo, it'll be hard to keep things in sync)
  • we'll need a way to add the logging capability in mcp-server
  • we'll also need a protocol msg for setting the log level - logging/setLevel (that seems to be part of the initial msg flow)

Copy link
Collaborator

@baxen baxen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great direction!


// Set up logging in the default cache directory
println!("Setting up logging for extension {}", config.name());
let log_path = format!("{}/.cache/goose/logs/{}.log",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: use the etcetera crate like in other logging


use super::LogMessage;

pub struct FileLogger {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: i wonder if it would be more consistent/easier to forward to tracing? please disregard if that adds a lot of complexity, but off the top of my head it might make it easier to control both file and stderr based logging etc

Copy link
Collaborator

@wendytang wendytang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! idk if it was just me, but i had a little bit of a hard time tracing. not sure if there's room to simplify?

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.

4 participants