feat(forgejo): route triggers to one session per issue or pull request #34
No reviewers
Labels
No labels
Agent
Ignore
Agent
In Progress
Agent
Planned
Agent
Planning
Agent
Ready
Agent
Triage
Compat
Breaking
Kind
Bug
Kind
Documentation
Kind
Enhancement
Kind
Feature
Kind
Security
Kind
Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lucas/omp-deck!34
Loading…
Reference in a new issue
No description provided.
Delete branch "31-forgejo-session-routing-per-issue-pull-request"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Webhook triggers on the same
(repo, number)now continue one deck session. A newforgejo_sessionstable maps each artifact to its session. The dispatcher resumes the mapped session viaensureSessionLiveand checks it lazily: if the session is archived, missing, fails to resume, has a different cwd, or its trigger is missing or for another artifact, a new session is created and the mapping is overwritten. That replacement is logged and nothing is posted to Forgejo. Dispatch is now split intogate(unclaimed, so held rows staypendingacross restarts) andrunReady, driven by a per-repo FIFO worker.While any deck session in the repo's workspace is open, unattended turns wait.
WsHubexposesopenSessionIds,onPresenceChangeandsendToSession. The new frames areforgejo_heldandforgejo_activity(also replayed on subscribe) plus the client frameforgejo_inject. The web chat showsForgejoBanners: the list of held triggers, an Inject button on the artifact's own session, and the "Forgejo agent is working in this workspace" warning.Decisions
forgejo_conversationorforgejo_pull_request) as long as owner/repo/number match. The plan only namedforgejo_conversation, but PR triggers createforgejo_pull_requestsessions since step 13.streamingBehavior: "followUp"for every trigger turn. On an idle session this makes no difference.errorframe withsessionId(shown as the session'slastError), so there is no newforgejo_inject_failedframe.inject()is synchronous and returns once the injected turns have started.014-forgejo-sessions.sql, because013was already taken. It adds an index onsession_idfor the reverse lookup.Verification
bun test src/forgejo/dispatcher.test.ts src/db(apps/server): 66 pass, 0 fail. New tests cover: one session across triggers; replacement when the mapped session is archived, not found, missing its trigger row, has a different cwd, or has a trigger for another artifact; holding while another workspace session is open, then running and disposing after it closes; Inject running the artifact's triggers in order without disposing while another artifact stays held; the activity warning during an unattended turn; refused inject for unmapped or other-repo sessions.bun testin apps/server: 771 pass, 0 fail.bun run typecheckat the root (protocol, server, web): all exit 0.Closes #31