Skip to content

bug(agents): unguarded sessionManager read makes launches crash without a session manager #1709

Description

@danielgap

Before submitting

  • I searched open and closed issues and did not find a report of this problem.
  • I reviewed this report and removed credentials, tokens, private paths, hostnames, and other sensitive data.

Problem

The #1064 launch seam reads the parent session id with ctx.sessionManager.getSessionId() in extensions/gentle-agents.ts, while every other binding reader guards the access (ctx.sessionManager?.getSessionId?.() in extensions/gentle-ai.ts). The optional-chaining pattern elsewhere treats sessionManager as possibly absent, but the launch path makes it load-bearing: a host context that provides no sessionManager throws on the unguarded dereference before the launch queues.

Raised as advisory R3-unguarded-session-id-read (suggestion) by the review-reliability lens during the native review of PR #1558.

Steps to reproduce

  1. Construct the writer launch path (task-request creation) with an extension context that omits sessionManager, as test harnesses do.
  2. Queue a subagent launch.
  3. The unguarded ctx.sessionManager.getSessionId() read fails instead of treating the session as unbound.

Expected and actual behavior

Expected: the launch seam guards the read like the panel, status, and usage seams, and a missing sessionManager resolves to an unbound session.
Actual: the direct call makes sessionManager a hard requirement for every launch.

gentle-pi version

Unreleased: feat/1064-session-effective-routing at 4ffe4f9 (PR #1558).

Pi version

1.0.0

Operating system

Linux

Relevant logs or error output (optional)

No response

Activity

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

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