Skip to content

OLS-3462: define system prompt for sandbox agent#279

Open
falox wants to merge 11 commits into
openshift:mainfrom
falox:add-system-prompt
Open

OLS-3462: define system prompt for sandbox agent#279
falox wants to merge 11 commits into
openshift:mainfrom
falox:add-system-prompt

Conversation

@falox

@falox falox commented Jul 5, 2026

Copy link
Copy Markdown

Load a system prompt from templates/system_prompt.tmpl describing the
OpenShift SRE role, available CLI tools, investigation protocol, and
Prometheus querying instructions. Previously the operator sent an empty
system prompt, causing the sandbox to fall back to a generic default.

Related to #273

The focus is currently on the prompt's content, not on the wiring. See #279 (comment).

Assisted-by: Claude Code:claude-opus-4-6

tremes and others added 11 commits July 1, 2026 14:20
The Claude Code Bash tool requires a writable ~/.claude directory on
startup. With readOnlyRootFilesystem: true and no writable volume at
/home/agent, executions fail with EACCES when the tool tries to
mkdir /home/agent/.claude.

Add an emptyDir volume "home" mounted at /home/agent in the bootstrap
SandboxTemplate, bare-pod PodSpecBuilder, and e2e test sandbox template.

Signed-off-by: Tomáš Remeš <tremes@redhat.com>
Assisted-by: Claude Code:claude-opus-4-6
The OpenAI Agents SDK creates a .agents directory inside the
read-only skills image volume at runtime to stage loaded skills.
Add a skills-workdir emptyDir volume mounted at /app/skills/.agents
so the SDK can write there while keeping skill content read-only.

Covered by new assertions in podspec_builder and bootstrap tests.

Signed-off-by: Tomáš Remeš <tremes@redhat.com>
Assisted-by: Claude Code:claude-opus-4-6
…v9.8-1782910875

Signed-off-by: red-hat-konflux <126015336+red-hat-konflux[bot]@users.noreply.github.com>
Adds agentic-operator child spec for temporary audit log storage:
OTLP log emission, templog-cleanup finalizer, and CRD spec.templog.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…v9.8-1782980183

Signed-off-by: red-hat-konflux <126015336+red-hat-konflux[bot]@users.noreply.github.com>
Signed-off-by: red-hat-konflux <126015336+red-hat-konflux[bot]@users.noreply.github.com>
Signed-off-by: red-hat-konflux <126015336+red-hat-konflux[bot]@users.noreply.github.com>
Signed-off-by: red-hat-konflux <126015336+red-hat-konflux[bot]@users.noreply.github.com>
…to 925bb5d

Signed-off-by: red-hat-konflux <126015336+red-hat-konflux[bot]@users.noreply.github.com>
Signed-off-by: red-hat-konflux <126015336+red-hat-konflux[bot]@users.noreply.github.com>
Load a system prompt from templates/system_prompt.tmpl describing the
OpenShift SRE role, available CLI tools, investigation protocol, and
Prometheus querying instructions. Previously the operator sent an empty
system prompt, causing the sandbox to fall back to a generic default.

Related to openshift#273

Signed-off-by: Alberto Falossi <afalossi@redhat.com>
Assisted-by: Claude Code:claude-opus-4-6
@openshift-ci-robot

openshift-ci-robot commented Jul 5, 2026

Copy link
Copy Markdown

@falox: This pull request references OLS-3462 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Load a system prompt from templates/system_prompt.tmpl describing the
OpenShift SRE role, available CLI tools, investigation protocol, and
Prometheus querying instructions. Previously the operator sent an empty
system prompt, causing the sandbox to fall back to a generic default.

Related to #273

Assisted-by: Claude Code:claude-opus-4-6

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 5, 2026
@openshift-ci openshift-ci Bot requested review from joshuawilson and raptorsun July 5, 2026 15:23
@openshift-ci

openshift-ci Bot commented Jul 5, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign onmete for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Adds templog specification documents (OTLP log emission, Proposal finalizer for PostgreSQL cleanup, CRD field), introduces home and skills-workdir emptyDir volumes in podspec/sandbox bootstrap code and tests, wires a new default system prompt template into the sandbox agent, and bumps Tekton bundle digests, Dockerfile base image, and go.mod dependencies.

Changes

Templog spec and sandbox feature implementation

Layer / File(s) Summary
Templog and audit-logging spec docs
.ai/spec/what/templog.md, .ai/spec/what/audit-logging.md, .ai/spec/what/crd-api.md
Adds templog.md covering OTLP log emission and finalizer-based PostgreSQL cleanup; updates audit-logging.md with matching subsections and cross-references; documents spec.templog CRD field.
Default system prompt template
controller/proposal/templates/system_prompt.tmpl, controller/proposal/sandbox_agent.go
Adds a new system prompt template (environment, response rules, tool usage, Prometheus querying, style) and passes it to client.Run instead of an empty string.
Home and skills-workdir volumes
controller/proposal/podspec_builder.go, controller/proposal/podspec_builder_test.go, controller/sandbox/bootstrap.go, controller/sandbox/bootstrap_test.go, test/agent/sandboxtemplate/sandboxtemplate.yaml
Adds home and skills-workdir emptyDir volumes/mounts to pod specs and sandbox templates, replacing the image-backed skills volume in bootstrap, with updated tests and fixtures.

Build pipeline and dependency updates

Layer / File(s) Summary
Tekton, Dockerfile, go.mod version bumps
.tekton/lightspeed-agentic-operator-pull-request.yaml, .tekton/lightspeed-agentic-operator-push.yaml, Dockerfile, go.mod
Bumps task bundle digests in both Tekton pipelines, updates the Dockerfile builder base image tag, and upgrades go-openapi/swag, jsonpointer, procfs, genproto, and grpc dependency versions.

Possibly related issues

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title matches the main change: defining a system prompt for the sandbox agent.
Description check ✅ Passed The description directly describes loading the new system prompt and the previous empty-prompt behavior.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@falox

falox commented Jul 5, 2026

Copy link
Copy Markdown
Author

/hold

We're using PR to run experiments, but the global system prompt technique isn't necessarily the final solution. The current goal is to figure out the prompt fragment to give to the sandbox. It will then be integrated into the skills. Finally, we need to determine whether and what to change depending on the phase.

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 5, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.ai/spec/what/templog.md:
- Around line 1-3: The intro and cross-references in templog.md are
self-referential, which creates a circular parent-spec link. Update the wording
in this document so it points to the actual parent/spec source instead of
referencing itself, and adjust the related cross-reference text in the same
section to remove the “parent spec” loop while keeping the hierarchy clear.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c733f1a0-5a5a-49b0-9af6-8ec61cd99353

📥 Commits

Reviewing files that changed from the base of the PR and between 01854cd and 78ba251.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum, !go.sum
📒 Files selected for processing (14)
  • .ai/spec/what/audit-logging.md
  • .ai/spec/what/crd-api.md
  • .ai/spec/what/templog.md
  • .tekton/lightspeed-agentic-operator-pull-request.yaml
  • .tekton/lightspeed-agentic-operator-push.yaml
  • Dockerfile
  • controller/proposal/podspec_builder.go
  • controller/proposal/podspec_builder_test.go
  • controller/proposal/sandbox_agent.go
  • controller/proposal/templates/system_prompt.tmpl
  • controller/sandbox/bootstrap.go
  • controller/sandbox/bootstrap_test.go
  • go.mod
  • test/agent/sandboxtemplate/sandboxtemplate.yaml
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • openshift/lightspeed-agentic-sandbox (manual)

Comment thread .ai/spec/what/templog.md
Comment on lines +1 to +3
# Temporary Audit Log Storage — Agentic Operator

Implementation details for the agentic-operator's role in the templog feature. See parent spec `what/templog.md` for requirements and architecture.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Break the self-referential parent-spec links.

This file points readers to what/templog.md as the “parent spec” in both the intro and cross-references, but this file already is what/templog.md. That makes the hierarchy circular and the link unhelpful.

Also applies to: 41-45

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.ai/spec/what/templog.md around lines 1 - 3, The intro and cross-references
in templog.md are self-referential, which creates a circular parent-spec link.
Update the wording in this document so it points to the actual parent/spec
source instead of referencing itself, and adjust the related cross-reference
text in the same section to remove the “parent spec” loop while keeping the
hierarchy clear.

@openshift-ci

openshift-ci Bot commented Jul 5, 2026

Copy link
Copy Markdown

@falox: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants