Skip to content

takeover: late input callers can rebuild coordination for a torn-down session #213

Closed

Description

@ElbertePlinio

Follow-up from the #212 review (#170), under #118.

A session whose first agent input arrives after teardown has no takeover identity record yet. withSessionDirectory(create=true) then reuses or recreates the session directory, creates permits/, publishes a fresh record and grants the permit. checkHumanLeaseBusy sees no lease for the dead id, so the action runs.

Scenario: a desktop action resolves session A's display and stalls before withAgentPermit. A is torn down (with or without explicit prune), and a new session B reuses the display and enters human control. The stalled action resumes, gets a permit for A and delivers input to B's display.

A probe against main confirms that withAgentPermit runs its action for a destroyed, retained session that never took input. Sessions that did take input already fail closed, and #212 keeps them that way after prune.

  • Refuse to create takeover coordination for an id without a live registry record (or an equivalent validated-initialization check)
  • Keep legacy storage and retained directories readable for diagnostics
  • Regression test: a delayed input call across teardown never runs its action
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