OCS Mattermost OCS Plugin
Guide

Configuration Guide

How to shape service access, runtime behavior, session policy, and bot-specific defaults for real deployment.

Service

These values control how Mattermost reaches your OpenCode server.

  • service.base_url: OpenCode server base URL
  • service.username: Basic Auth username
  • service.password: Basic Auth password
  • service.allow_hosts: optional comma-separated allow list

Runtime

  • runtime.default_timeout_seconds: default request timeout
  • runtime.enable_streaming: enable SSE-backed post updates
  • runtime.streaming_update_ms: post refresh cadence
  • runtime.context_post_limit: number of recent Mattermost posts injected as context
  • runtime.max_input_length and runtime.max_output_length: prompt and response guardrails
  • runtime.enable_usage_logs: structured diagnostics for operations

OpenCode Defaults

Use opencode_defaults.provider_id, opencode_defaults.model_id, and opencode_defaults.agent_id to define global fallbacks when a bot does not override them.

Session Policy

  • session_policy.reuse_scope: thread, dm, or channel
  • session_policy.idle_expire_minutes: replace inactive sessions after the configured idle window

Bot Definitions

Each bot can define its own display name, prompt, model, agent, access control rules, tool policy, and mode.

Conversation Mode

Use for summaries, drafting, support, and general assistant workflows that do not need coding-specific UI.

Coding Mode

Use for project-aware development help, task cards, command approval, and session diff review.

Coding Settings

  • coding.profile: semantic role such as implementer or reviewer
  • coding.workspace_root: optional OpenCode project-relative working directory hint
  • coding.allowed_paths: restrict surfaced project paths
  • coding.command_allowlist: approved command prefixes
  • coding.require_command_approval: require an explicit user action before execution
  • coding.include_workspace_snapshot and coding.include_referenced_files: prompt enrichment controls
가이드

설정 가이드

서비스 접근, 런타임 동작, 세션 정책, 봇별 기본값을 실제 운영 기준으로 어떻게 잡을지 설명합니다.

Service

Mattermost가 OpenCode 서버에 어떻게 연결할지 결정하는 값들입니다.

  • service.base_url: OpenCode 서버 기본 URL
  • service.username: Basic Auth 사용자명
  • service.password: Basic Auth 비밀번호
  • service.allow_hosts: 선택적 허용 호스트 목록

Runtime

  • runtime.default_timeout_seconds: 기본 요청 타임아웃
  • runtime.enable_streaming: SSE 기반 포스트 갱신 사용 여부
  • runtime.streaming_update_ms: 포스트 갱신 주기
  • runtime.context_post_limit: 컨텍스트로 넣을 최근 Mattermost 포스트 수
  • runtime.max_input_length, runtime.max_output_length: 입력과 출력 길이 가드레일
  • runtime.enable_usage_logs: 운영 진단용 사용 로그 저장 여부

OpenCode Defaults

opencode_defaults.provider_id, model_id, agent_id는 봇이 따로 지정하지 않았을 때 쓰는 전역 기본값입니다.

Session Policy

  • session_policy.reuse_scope: thread, dm, channel
  • session_policy.idle_expire_minutes: 일정 시간 미사용 세션 교체 기준

Bot Definitions

각 봇은 표시 이름, 프롬프트, 모델, 에이전트, 접근 제한, 도구 정책, 실행 모드를 따로 가질 수 있습니다.

대화 모드

요약, 초안 작성, 지원형 봇, 일반 어시스턴트 흐름에 적합합니다.

코딩 모드

프로젝트 기반 개발 지원, 태스크 카드, 명령 승인, session diff 확인에 적합합니다.

코딩 설정

  • coding.profile: implementer, reviewer 같은 역할 이름
  • coding.workspace_root: OpenCode 프로젝트 상대 기준 작업 디렉터리 힌트
  • coding.allowed_paths: 노출 가능한 프로젝트 경로 제한
  • coding.command_allowlist: 허용 명령 prefix
  • coding.require_command_approval: 실행 전 사용자 승인 필요 여부
  • coding.include_workspace_snapshot, coding.include_referenced_files: 프롬프트 보강 옵션