Skip to content

feat(opencode): workflow-session integration (Phase B) - #14

Merged
qkhalk merged 3 commits into
mainfrom
workflow-session-integration
Aug 27, 2026
Merged

qkhalk merged 3 commits into
mainfrom
workflow-session-integration

Conversation

@qkhalk

@qkhalk qkhalk commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Add session-bridge.ts and permission-scope.ts for workflow-session integration and per-step permission scoping.

…hase 4)

Add two new modules to the OC Kit workflow system:

1. session-bridge.ts — Connects the workflow engine to OpenCode's session
   system. Workflows can be triggered from within sessions, their runs tracked
   per-session, and results fed back into session history. Provides
   triggerWorkflow() and triggerAndReport() with typed error handling.

2. permission-scope.ts — Controls which tools and agents are available during
   each workflow step, based on kit-level defaults and per-step overrides.
   Provides resolveStepPermissions(), isToolAllowed(), isAgentAllowed(), and
   filter helpers.

Both modules follow the project's Effect Schema conventions and include
comprehensive unit tests.
Copilot AI lite review requested due to automatic review settings August 26, 2026 22:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

Copy link
Copy Markdown

The following comment was made by an LLM, it may be inaccurate:

Fix type errors in session-bridge.ts and permission-scope.ts:

1. permission-scope.ts: Rewrite to use actual KitSkill.permissions type
   (Record<string, "allow"|"deny">) instead of non-existent fields.
   Use step.skill instead of step.run.

2. session-bridge.ts: Use "CREATED" instead of "PENDING" for initial state.
   Fix RECOVERED check to use recovered boolean flag.

3. Tests: Update to use correct types (skill instead of run, proper
   KitSkill structure).
1. Add missing isAgentAllowed and filterAllowedAgents functions to
   permission-scope.ts
2. Remove name field from skill fixtures in tests (not in KitSkill type)
3. Remove name field from workflow fixture (not in Workflow type)
@qkhalk
qkhalk merged commit 8eb697d into main Aug 27, 2026
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants