Luigit
repositories / smith

smith

There are many coding harnesses - but this one is fast

owned by admin

.system/issues/SMH-ISSUE-7RKFK2JJ-cli-reopens-fixed-session-files-across-invocatio/index.md

Raw
Rendered preview

id: SMH-ISSUE-7RKFK2JJ type: issue status: resolved title: "CLI reopens fixed session files across invocations" specs: [SMH-SPEC-SPEC0001]

CLI reopens fixed session files across invocations

Symptom

Eval always opens $XDG_DATA_HOME/smith/sessions/run/eval.smh; RPC always opens sibling rpc.smh. Unset XDG data home defaults to ~/.local/share on Linux. Repeated invocations restore previous history without explicit resume selection.

Impact

Unrelated runs share conversation context and durable history. Eval does not create a distinct named session by default. Concurrent invocations of the same mode contend for the same session lock.

Evidence

Code-path reproduction: two sequential eval invocations with the same data home.

sequenceDiagram
    participant U as Caller
    participant C as CLI
    participant S as Session store
    U->>C: First eval invocation
    C->>S: Open run/eval.smh
    S-->>C: New session when file absent
    C->>S: Append turn history
    U->>C: Second eval invocation
    C->>S: Open run/eval.smh again
    S-->>C: Restore first invocation history
    C->>S: Append unrelated turn to same session
  • smith-cli/src/main.rs:347,389: fixed eval/RPC filenames.
  • smith-cli/src/main.rs:452: shared sessions/run directory.
  • smith/src/config.rs:57: platform data directory resolution.
  • smith-core/src/store.rs:186: existing header triggers session restoration.

Evidence from source inspection; binary reproduction not run.

Resolution

Resolved by unique default session IDs, explicit --session resume, and binary e2e coverage for distinct sessions and resume. The original fixed filenames and source evidence remain above as historical context.

Related contract

Smith Specification: Eval: auto-create a named session by default. RPC shares the fixed-path behavior; cited contract does not explicitly define default RPC session identity.

---
id: SMH-ISSUE-7RKFK2JJ
type: issue
status: resolved
title: "CLI reopens fixed session files across invocations"
specs: [SMH-SPEC-SPEC0001]
---

# CLI reopens fixed session files across invocations

## Symptom

Eval always opens `$XDG_DATA_HOME/smith/sessions/run/eval.smh`; RPC always opens sibling `rpc.smh`.
Unset XDG data home defaults to `~/.local/share` on Linux.
Repeated invocations restore previous history without explicit resume selection.

## Impact

Unrelated runs share conversation context and durable history.
Eval does not create a distinct named session by default.
Concurrent invocations of the same mode contend for the same session lock.

## Evidence

Code-path reproduction: two sequential eval invocations with the same data home.

```mermaid
sequenceDiagram
    participant U as Caller
    participant C as CLI
    participant S as Session store
    U->>C: First eval invocation
    C->>S: Open run/eval.smh
    S-->>C: New session when file absent
    C->>S: Append turn history
    U->>C: Second eval invocation
    C->>S: Open run/eval.smh again
    S-->>C: Restore first invocation history
    C->>S: Append unrelated turn to same session
```

- `smith-cli/src/main.rs:347,389`: fixed eval/RPC filenames.
- `smith-cli/src/main.rs:452`: shared sessions/run directory.
- `smith/src/config.rs:57`: platform data directory resolution.
- `smith-core/src/store.rs:186`: existing header triggers session restoration.

Evidence from source inspection; binary reproduction not run.

## Resolution

Resolved by unique default session IDs, explicit `--session` resume, and binary e2e coverage for distinct sessions and resume.
The original fixed filenames and source evidence remain above as historical context.

## Related contract

[Smith Specification: Eval](../../specs/SMH-SPEC-SPEC0001-smith-specification/index.md#eval): auto-create a named session by default.
RPC shares the fixed-path behavior; cited contract does not explicitly define default RPC session identity.