Skip to content

fix(cli): session not found names the owning profile - #403

Open
ayushsingh82 wants to merge 1 commit into
agentrhq:mainfrom
ayushsingh82:fix/388-session-not-found-owning-profile
Open

fix(cli): session not found names the owning profile#403
ayushsingh82 wants to merge 1 commit into
agentrhq:mainfrom
ayushsingh82:fix/388-session-not-found-owning-profile

Conversation

@ayushsingh82

Copy link
Copy Markdown
Contributor

Fixes #388.

Problem

SESSION_NOT_FOUND said Session not found: <id> even when the id
existed under a different profile, and session list gave no visible
signal that its output was scoped to the selected profile. Agents that
created sessions under a named profile and later ran session close
or session list without repeating --profile read the error as
"session doesn't exist" and either retried the same wrong command or
inspected unrelated default-profile state.

Fix

  • SessionNotFoundError now looks up the session's actual owning
    profile in the store and, when it differs from the selected one,
    names it in the hint with the exact retry command:
    webcmd --profile <owner> session close <id>. Falls back to the
    existing generic hint when the id doesn't exist under any profile.
  • session list table/JSON output now includes a profileId column,
    so the output doesn't read as global when it's profile-scoped.
  • Updated docs/troubleshooting.mdx and the webcmd-browser skill's
    troubleshooting table with the new behavior.

Test plan

  • npm run typecheck — clean.
  • npm run test — 447 files / 5757 tests pass.
  • make verify — skill build (skill-src/skills/) in sync.
  • Added coverage in src/browser/sessions.test.ts for both the
    owning-profile hint and the fallback (unknown session id) hint.

SESSION_NOT_FOUND said "Session not found: <id>" even when the id
existed under a different profile, and `session list` gave no visible
signal that it was scoped to the selected profile. Agents omitting
--profile on cleanup read this as the session never existed and either
retried the same wrong command or inspected unrelated default-profile
state.

- SessionNotFoundError now looks up the owning profile and, when found,
  hints the exact `webcmd --profile <owner> session close <id>` retry.
- `session list` includes a `profileId` column so scoping is visible
  in table output, not just implied by the selected profile.

Fixes agentrhq#388
@github-actions

Copy link
Copy Markdown
Contributor

🟠 Maintainer review suggested — low confidence

The automated review could not reach a fully supported conclusion.

Limitations

  • The automated review returned an invalid structured result.

This review is advisory and does not block merging.

@ayushsingh82

Copy link
Copy Markdown
Contributor Author

@ankitranjan7 mind taking a look? This closes #388.

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.

cli: session commands without --profile should name the owning profile

1 participant