Skip to content

feat(runs): FAC-160 Mine includes runs an integration trigger started for me - #1192

Merged
kora-agent merged 3 commits into
mainfrom
factory/FAC-160-runs-mine-filter
Dec 2, 2026
Merged

kora-agent merged 3 commits into
mainfrom
factory/FAC-160-runs-mine-filter

Conversation

@runkora

@runkora runkora Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

What and why

The Runs tab's Mine chip missed runs an integration trigger started for me (matched through my account link); they showed only under a separate Started by me chip. This adds a mine=true run list filter, meaning created_by = me OR started_by_user_id = me (an empty subject matches nothing). It is applied in the list query and the stream matcher, so the list and live stream agree. created_by and started_by_user still work for API callers. The Mine chip now sends mine=true, and the Started by me chip is removed. The My usage "started for me" link now points at quick=mine. The kora MCP runs.list tool takes mine, and the docs describe it.

Work-item: https://plane.clearroute.io/kora/browse/FAC-160/

How it was tested

  • go build ./... and go test ./internal/agents/ ./internal/koramcp/... pass, with new cases: the caller's own run, a run whose sender matched the caller, another person's run, no subject, and parser validation for mine.
  • Frontend: pnpm tsc --noEmit, pnpm lint (one existing warning), and the unit tests for runs and my-usage pass. The BFF integration tests for runs pass.
  • Not run: make test-postgres and make check. The sandbox has no Docker or Postgres. I added Mine cases to the Postgres list-versus-matcher agreement test in run_page_postgres_test.go, and they are unverified. go test ./internal/agents/sessionmanager fails on TestACPExecSpawn_CancelKillsProcessGroup. I did not touch that package.
  • The QA check on a dev cluster is still to do.

Checklist

  • make check passes. Not run here.
  • Every commit is signed off.
  • Documentation reflects the change.

…on trigger started for me

Adds a mine=true run list filter (created by the caller or sender matched to the caller) to the list query, stream matcher, BFF, MCP runs.list and docs. The Runs tab Mine chip sends it; the Started by me chip is removed.

Signed-off-by: kora-agent <agent@runkora.io>
@runkora

runkora Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Visual Walkthrough

The Mine filter now sends mine=true, which keeps runs the caller created or whose integration sender matched the caller, and the Started by me chip is removed.

Mine filter entry points

The Mine chip and the MCP runs.list tool both send mine=true to the agents API, which parses it into the run list query.

flowchart TB
    subgraph sUI [Runs page]
        chip[Mine chip]
        gone[Started by me chip]
        params[runFilterParams]
    end
    subgraph sProxy [Frontend proxy]
        fwd[FILTER_PARAMS allowlist]
    end
    subgraph sMCP [kora MCP server]
        tool[runs.list tool]
    end
    subgraph sAPI [Agents API]
        handler[handleListRuns]
        parse[Mine query filter]
        repo[ListRuns SQL]
    end
    chip -->|mine=true| params
    gone -.->|was started_by_user me| params
    params -->|keeps mine param| fwd
    fwd -->|forwards to API| handler
    tool -->|mine=true query| handler
    handler -->|parses mine value| parse
    parse -->|adds caller match| repo
    classDef added fill:#1f883d,stroke:#1a7f37,stroke-width:2px,color:#ffffff
    classDef changed fill:#bf8700,stroke:#9a6700,stroke-width:2px,color:#ffffff
    classDef removed fill:#cf222e,stroke:#a40e26,stroke-width:2px,stroke-dasharray:5,color:#ffffff
    classDef context fill:transparent,stroke:#8c959f,stroke-width:1px,stroke-dasharray:3,color:#8c959f
    linkStyle default stroke:#8c959f,stroke-width:2px
    class chip,params,fwd,tool,handler,parse,repo changed
    class gone removed
    style sUI fill:transparent,stroke:#8c959f
    style sProxy fill:transparent,stroke:#8c959f
    style sMCP fill:transparent,stroke:#8c959f
    style sAPI fill:transparent,stroke:#8c959f
Loading

Legend: green = added, amber = changed, red = removed, dashed grey = context

Node Code Symbols
Mine chip index.ts QUICK_FILTERS
Started by me chip index.ts QUICK_FILTERS
runFilterParams index.ts runFilterParams
FILTER_PARAMS allowlist runs-server.ts FILTER_PARAMS, pickRunsStreamParams
runs.list tool tools_runs.go listRunsArgs, listRunsQuery
handleListRuns server.go handleListRuns
Mine query filter run_page.go parseRunFilters, matchesMine
ListRuns SQL postgres.go ListRuns
Mine query path

A request with mine=true is refused unless the value is exactly true. An accepted request returns runs the caller created or whose trigger sender matched the caller.

sequenceDiagram
    participant R as Runs page
    participant A as Agents API
    participant P as Postgres
    R->>A: list runs with mine=true
    alt mine is not true
        A-->>R: error mine must be true
    else mine is true
        A->>P: query runs for caller
        P-->>A: created or started by caller
        A-->>R: runs page
    end
Loading
Node Code Symbols
Runs page index.ts runFilterParams
Agents API run_page.go parseRunFilters, matchesMine
Postgres postgres.go ListRuns

@runkora runkora Bot left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Walkthrough

Adds a mine=true run list filter, created_by = me OR started_by_user_id = me, used by the list query, stream matcher, Mine chip and MCP runs.list. The Started by me chip is removed.

Severity Finding Location
medium Align the "View runs" link with the count it sits beside started-for-me.tsx:18

Review effort: Medium
Risk: Medium, new run list filter in query and stream matcher
Coverage: 16 of 16 files reviewed

Where to focus

Area Why it needs a person
my-usage/_components/started-for-me.tsx Decide whether the link target should match the counted set.
backend/internal/agents/run_page_postgres_test.go Postgres list-versus-matcher cases were not run.
backend/internal/agents/postgres.go OR filter on two columns; index use not checked.
Changes by area
Area Files Change
backend/internal/agents 5 mine filter in query, matcher, parser and tests
backend/internal/koramcp 1 mine argument for runs.list
docs 2 Describe the mine filter
frontend 8 Mine chip sends mine=true; Started by me chip removed
Checked

Stream matcher and list query agreement; empty-subject handling; frontend filter parsing.

Signed-off-by: kora-agent <agent@runkora.io>

@runkora runkora Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Walkthrough

Relabels the My usage link to "View all my runs" and updates its test assertion to match. The link still targets quick=mine.

No new findings.

Fixed since the last review: Align the "View runs" link with the count it sits beside.

Review effort: Low
Risk: Low, link label and test assertion only
Coverage: 1 of 1 files reviewed

Where to focus

Area Why it needs a person
my-usage/_components/started-for-me.tsx Confirm "View all my runs" wording suits the integration-started count beside it.
Checked

Link label and test assertion agreement.

@runkora runkora Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Walkthrough

Replaces the "true" case literal in parseRunFilters with strconv.FormatBool(true). Behavior is unchanged.

No new findings.

Review effort: Low
Risk: Low, one-line literal change in query parsing
Coverage: 1 of 1 files reviewed

Where to focus

Area Why it needs a person
backend/internal/agents/run_page.go Confirm the goconst workaround is the form you want.
Checked

Run filter parsing in run_page.go.

@runkora

runkora Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

QA blocked for work-item FAC-160 (Runs tab: Mine includes runs an integration trigger started for me), head 0cabb83.

  • Pass: internal/agents and internal/koramcp Go tests, including the Mine list and stream-matcher agreement tests. (Unrelated failure in agents/sessionmanager TestACPExecSpawn_CancelKillsProcessGroup, a sandbox process-group issue in a package this PR does not touch.)
  • Pass: Postgres-backed tests against local Postgres 16 with all migrations. go test -p 1 ./internal/agents/ -run Postgres passes, including the Mine cases under every visibility scope. Run without -race and not via make test-postgres.
  • Pass: frontend pnpm lint (0 errors), pnpm tsc --noEmit, pnpm test:unit (1860 tests).
  • Not run: make check as a whole target.
  • Blocked: the dev-cluster check (linked Slack run and console run both under Mine, no Started by me chip). My sandbox has no cluster or linked Slack account. A human needs to run it.

@runkora

runkora Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

QA passed at head 0cabb83 for work-item FAC-160 (Runs tab: Mine includes runs an integration trigger started for me).

  • Pass: go test ./backend/internal/agents/.... internal/agents and internal/koramcp pass, including the Mine list and stream-matcher agreement tests. The one failure, agents/sessionmanager TestACPExecSpawn_CancelKillsProcessGroup, depends on sandbox process groups, and this PR does not touch that package.
  • Pass: Postgres-backed test. Run against a local Postgres 16 with all migrations, without -race and not through make test-postgres (needs Docker). The Mine cases pass under every visibility scope.
  • Pass: frontend. pnpm lint has 0 errors, pnpm tsc --noEmit is clean, and pnpm test:unit passes (1860 tests).
  • Not run as one target: make check. Its Go and frontend parts were run above.
  • Waived by a human: the dev-cluster check. Justin Wilkin said in Slack that QA does not need to run on a cluster and that local tests are enough. The factory watcher relayed this in a Plane comment. I did not read the Slack thread myself. Nothing was tested on a cluster.

The PR head is unchanged since those results, so they still apply.

@runkora
runkora Bot marked this pull request as ready for review December 2, 2026 08:49
@runkora
runkora Bot requested a review from a team as a code owner December 2, 2026 08:49
@kora-agent
kora-agent added this pull request to the merge queue Dec 2, 2026
Merged via the queue into main with commit effd3ad Dec 2, 2026
50 checks passed
@kora-agent
kora-agent deleted the factory/FAC-160-runs-mine-filter branch December 2, 2026 12:34
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