Skip to content

expose agent sessions and their compaction #232

Description

@gterzian

I think it could be interesting to expose browser agent sessions to applications, in particular for efficient compaction by the app itself.

Couple of ideas:

  • new events on MCPContext: sessionstart, sessioncompaction:
    • sessionstart fire when the UA starts the session, which I guess would be soon after document load (except if the session is shared between documents and was started earlier?) and would allow the app to send it's first observation.
    • sessioncompaction: fired when the context reaches an implementation define limit. The UA could just clear the context, and then the app could use the event to send an observation for the compacted state
    • both would require app driven observations.

The main benefit would be to allow the app itself to manage the context of the session, given that it is likely the app dev itself who is best placed to decide how to compact; for example for a ui app it could just send an observation with the latest relevant state, and then from then on only send deltas, and then resend the full state on compaction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions