Skip to content

refactor(pi): stop sending terminal session requests#10

Draft
ishandhanani wants to merge 2 commits into
mainfrom
idhanani/disable-pi-session-final
Draft

refactor(pi): stop sending terminal session requests#10
ishandhanani wants to merge 2 commits into
mainfrom
idhanani/disable-pi-session-final

Conversation

@ishandhanani

Copy link
Copy Markdown
Collaborator

Pi now sends session identity only and no longer issues a synthetic terminal request during shutdown. This keeps session lifecycle policy in Dynamo and avoids cancellation-prone cleanup traffic from clients.

How This Was Implemented

  • Removed the Pi shutdown hook and terminal chat-completion helper.
  • Removed the session-final environment/configuration surface and its tests.
  • Simplified the Harbor adapter and documented that Dynamo policies own expiry.
Walkthrough

Mental model

Ordinary model requests continue carrying Dynamo session headers. When Pi exits, it performs no additional model request; Dynamo expires retained session state according to its configured policy.

sequenceDiagram
    participant Pi
    participant Dynamo
    Pi->>Dynamo: ordinary request + session headers
    Dynamo-->>Pi: streamed response
    Note over Pi: process exits without terminal request
    Note over Dynamo: server-side retention expires session state
Loading

Request lifecycle

The provider still wraps streamSimple, preserves Pi's sessionId, and adds Dynamo identity headers to ordinary requests. Removing the shutdown hook means success, error, and process-exit paths no longer create a second synthetic chat completion.

Boundaries and limitations

This does not change session identity, parent/child linking, request tracing, tool-event relay, or ordinary model streaming. Dynamo must apply its own retention or cleanup policy; Pi provides no authoritative terminal-session signal.

Validation

  • npm run check
  • npm test (5 passed)
  • npm run build
  • python3 -m py_compile harbor/dynamo_pi.py

Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant