Skip to content

Context.last_turn doesn't correctly grab the response #1002

Closed

Description

@jakelorocco

Context.last_turn() only grabs the last response if it's a ModelOutputThunk. It should also explicitly look for Message types with a role field. Eventually, it should support all components that specify a role: #377.

Activity

  1. added
    bug
    enhancement
    on May 4, 2026
  2. jakelorocco commented on May 11, 2026

    @jakelorocco
    ContributorAuthor

    Another side-effect of the current implementation: if the last addition to the context is a Message(role="assistant"), it will actually pick that up as the start of the context turn. Any fix should also search out code that is manually doing this manipulation / fix, ie mellea/stdlib/components/intrinsic/_util.py _resolve_response function.

  3. added
    area/context
    and removed
    enhancement
    on May 20, 2026
  4. added
    p1
    on Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/contextbugp1

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions