feat(edge-worker): cloud-runtime package-install system prompt addendum (CYPACK-1266)#1272
Open
cyrusagent wants to merge 3 commits into
Open
feat(edge-worker): cloud-runtime package-install system prompt addendum (CYPACK-1266)#1272cyrusagent wants to merge 3 commits into
cyrusagent wants to merge 3 commits into
Conversation
…um (CYPACK-1266) When the CYRUS_CLOUD_RUNTIME env var is truthy, append a system-prompt addendum instructing the agent to direct users to https://app.atcyrus.com/settings/packages to install missing apt/npm packages rather than installing them ad-hoc. Off by default for self-host. Mirrors the existing browser-use addendum pattern: a single gated module chained into appendSystemPrompt at both RunnerConfigBuilder build sites (chat + issue), so it applies on both cold starts and continuation runs.
PaytonWebber
approved these changes
May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements CYPACK-1266: on Cyrus-managed cloud runtimes, the agent now knows that missing system packages must be added through the dashboard rather than installed ad-hoc.
CYHOST-994 introduces a way for users to add system-wide
apt/npmpackages to their VPS. Since Cyrus has no intrinsic way of knowing it's running on a managed cloud runtime, this PR gates the behavior behind a new env var,CYRUS_CLOUD_RUNTIME. When it's truthy, a system-prompt addendum tells the agent: if a package is missing, don't try tosudo apt install/npm install -g(won't persist, may fail on perms) — instead direct the user to https://app.atcyrus.com/settings/packages to add the exact package(s) needed, naming them and explaining why, and continue with whatever work isn't blocked.Approach (SOLID)
Mirrors the existing browser-use addendum precedent exactly:
packages/edge-worker/src/prompts/cloudRuntimePromptAddendum.ts— owns the addendum text and a pureappendCloudRuntimeAddendum()that is a no-op unlessCYRUS_CLOUD_RUNTIMEis truthy (1/true/yes, case/space-insensitive).RunnerConfigBuilderbuildsappendSystemPromptfor both chat and issue sessions; the new addendum wraps the existingappendBrowserUseAddendum(appendFailureModeAddendum(...))chain at both sites.Code paths considered (cold start + hot refresh)
RunnerConfigBuilderis the single point through which every runner config flows — both the chat-session and issue-session build sites are updated. The env var is read fresh each time a runner config is assembled, so it applies identically on cold starts (new session) and continuation/resume runs. No config-schema plumbing is needed since this is a runtime env var, not aconfig.jsonfield — so there's noConfigManagerwhitelist or path-normalization codepath to update.Testing
cloudRuntimePromptAddendum.test.ts(6 cases): unset/falsy → unchanged, truthy spellings, separator behavior, verbatim-when-empty, and presence of the settings link + apt/npm guidance.build+typecheckpass (run via pre-commit hook).Changelog
Added an
## [Unreleased]entry referencing CYPACK-1266 and this PR.