Skip to content

agent/reset returns true even when the agent has no reset hook #27

Description

@aniketwattamwar

Problem

In sdk/python/src/ecp/server.py, _handle_reset runs the hook if one is registered and returns true either way:

def _handle_reset():
    method_name = _HOOKS["reset"]
    if method_name:
        handler = getattr(_CURRENT_AGENT_INSTANCE, method_name)
        _invoke_handler(handler)
    return True

An agent with no @on_reset claims a successful reset. Scenario isolation silently does not happen, and state leaks between scenarios while the runtime believes it was cleared.

Proposal
Tie this to the reset capability (#TBD). Agents without the hook stop declaring reset, and the runtime warns on multi-scenario runs instead of being lied to.

Acceptance criteria

  • reset capability reflects whether a hook is actually registered
  • Runtime warns when running multiple scenarios against an agent without it
  • Test covering an agent with no @on_reset

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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