stacklok / stacklok/mecatl

Session capabilities never grant delete/rename while a session is parked awaiting approval

Open
#654 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
152
Forks
16
Avg merge
14h 48m
Merged PRs (30d)
536

Description

Symptom

A session parked awaiting approval cannot be deleted or renamed. Any client showing capability-gated actions on such a session sees both denied, with a daemon-supplied reason of awaiting_approval. There is no way to get rid of a session you no longer want, short of resolving an approval you don't want to resolve.

Root cause

This is a daemon-side capability decision, not a client bug. The session row's canRename/canDelete capabilities — and the awaiting_approval denial reason attached to them — are computed daemon-side and simply passed through by the client; a client that gates its UI on those capabilities (rather than re-deriving eligibility itself, which is the correct client-side discipline) will always see both actions denied while the session sits in StateAwaiting.

So the fix belongs on the daemon side of the boundary: nothing in a client's rename/delete affordance is wrong, the daemon just never offers those capabilities for a parked session today.

Proposed fix

Grant delete (and arguably rename) while a session is StateAwaiting, with delete cancelling the parked run as part of the operation. A session parked on a human verdict is waiting on the operator by definition — the operator choosing "discard this entirely" is a legitimate resolution of that wait, not a race against an in-flight run.

Worth deciding together with the parked-run-cancellation issue (previously filed as #653, now reworded to describe the general daemon bug), since both hinge on what a parked run is allowed to outlive.

Open lookup

Where the session-row capabilities set and the awaiting_approval denial reason are computed daemon-side has not been pinned down yet — that's the first thing to find when picking this up.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named; first locate the daemon-side computation of the session-row capabilities and the awaiting_approval denial reason, then inspect how StateAwaiting is handled. Review issue #653 alongside this work, and consider the intended rename behavior. Done means a parked session can be deleted, deletion cancels the parked run, and the resulting capability decisions are covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
authorization, backend-api-design
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.