Skip to content

ci probe (will delete) - #3

Closed
wi-kshitij-nagvekar wants to merge 6 commits into
mainfrom
ci-trigger-probe
Closed

wi-kshitij-nagvekar wants to merge 6 commits into
mainfrom
ci-trigger-probe

Conversation

@wi-kshitij-nagvekar

Copy link
Copy Markdown
Collaborator

throwaway

nogoodusername and others added 6 commits September 22, 2026 09:10
Long-running Agents cache discovered skills at instance start, so updating
the cloned files on disk is invisible to a running OpenCode server. Skills
could not be kept in sync at all: Git contexts had a sync option, skill
sources did not.

Add sync to GitSkillSource, reusing the existing GitSync type so the field
shape matches Git contexts. Skills default to a 15m interval rather than the
5m used for contexts, because each applied change triggers a server instance
reload and skill catalogs change less often.

Add reload to GitSync for contexts to opt into the same re-scan behavior.
Skill sources always reload when syncing, since re-scanning is the point.

Rollout is rejected for skills: it needs the controller to compare remote
refs, which is not implemented for authenticated repositories, and would
otherwise be a silently ineffective option.
Populate the sync fields for skill sources in processSkills, mirroring the
existing Git context handling, and mark skill mounts as needing a server
re-scan after an update.

Pass OPENCODE_RELOAD_URL to git-sync sidecars whose mount requests a reload,
pointing at the agent's own server over loopback. Only Agent servers get it:
Task pods are ephemeral and never build git-sync sidecars, so the reload
concept does not apply there.
When a reload is requested, the sidecar asks the server to re-scan its
configuration so updated skills take effect without a Pod restart.

Disposal releases the whole server instance, so it must not run during an
active turn: doing so aborts the user's work (verified: the assistant message
ends with MessageAbortedError). The sidecar therefore checks session activity
and defers the reload while any session is busy, retrying every cycle.

The "server is behind" condition is persisted on the shared volume as the
commit hash the server last scanned. In-memory tracking was not enough: a
restarted sidecar would see an unchanged remote, conclude there was nothing
to do, and leave the server stale until the repository changed again.
Unit tests for the reload path against a fake OpenCode server: idle disposes,
busy refuses to dispose, disposal and status failures propagate, and malformed
status payloads fail closed rather than being read as idle.

Cover processSkills sync propagation (including the 15m default and implicit
reload for skills), the sidecar reload env gating, and the server wiring that
points the sidecar at the agent's own port. The server test uses a non-default
port so a hardcoded URL would fail.
Document why file sync alone cannot update skills in a running Agent (OpenCode
caches discovery at instance start) and how to enable the reload.

Add ADR 0043 recording the mechanism, the measured reload cost, and the
constraints: the idle gate that prevents aborting an active turn, the persisted
state that survives a sidecar restart, the names-filtering limitation, and why
plugins are out of scope.
@wi-kshitij-nagvekar
wi-kshitij-nagvekar deleted the ci-trigger-probe branch September 22, 2026 09:21
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.

2 participants