Skip to content

fix: include gist-instructions.md in container image and add missing K8s env vars (#202)#236

Merged
aviadshiber merged 4 commits intomainfrom
claude/handle-issue-202-VFSRs
Apr 11, 2026
Merged

fix: include gist-instructions.md in container image and add missing K8s env vars (#202)#236
aviadshiber merged 4 commits intomainfrom
claude/handle-issue-202-VFSRs

Conversation

@aviadshiber
Copy link
Copy Markdown
Owner

The gist feature (inject_gist: true) was silently broken because
gist-instructions.md was never copied into the container image. The
inject_gist_instructions() function found the file missing and returned
early without injecting anything.

Also adds missing KAPSIS_STATUS_PROJECT, KAPSIS_STATUS_AGENT_ID,
KAPSIS_STATUS_BRANCH, and KAPSIS_INJECT_GIST env vars to the K8s
backend CR generation, and upgrades the missing-file log from debug
to warn so users can diagnose the issue.

https://claude.ai/code/session_015Mb7CbNVwZLHqoQWh4vwnM

claude and others added 4 commits April 7, 2026 21:05
…K8s env vars (#202)

The gist feature (inject_gist: true) was silently broken because
gist-instructions.md was never copied into the container image. The
inject_gist_instructions() function found the file missing and returned
early without injecting anything.

Also adds missing KAPSIS_STATUS_PROJECT, KAPSIS_STATUS_AGENT_ID,
KAPSIS_STATUS_BRANCH, and KAPSIS_INJECT_GIST env vars to the K8s
backend CR generation, and upgrades the missing-file log from debug
to warn so users can diagnose the issue.

https://claude.ai/code/session_015Mb7CbNVwZLHqoQWh4vwnM
Address review findings:
- Apply _yaml_escape() to KAPSIS_STATUS_PROJECT and BRANCH in K8s CR
  to prevent YAML injection from special characters
- Replace UTF-8 em dash with ASCII double-hyphen in log message
- Add tests for workspace without CLAUDE.md/AGENTS.md (fallback only)
- Add test for explicit KAPSIS_INJECT_GIST=false

https://claude.ai/code/session_015Mb7CbNVwZLHqoQWh4vwnM
- Guard mkdir -p with error check to gracefully skip gist injection
  on read-only filesystems, matching inject_progress_instructions()
- Assert on stderr_output in test_inject_gist_missing_instructions_file
  to verify the warning is emitted

https://claude.ai/code/session_015Mb7CbNVwZLHqoQWh4vwnM
…ings

- Replace echo with printf '%s\n' in _yaml_escape() to handle values
  starting with -n, -e, -E that echo could misinterpret as flags
- Add test_yaml_escape_echo_flag_values to verify the fix
- Add test_inject_gist_readonly_workspace to cover the mkdir -p failure
  path added in a prior commit (read-only workspace graceful skip)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@aviadshiber aviadshiber merged commit 1b18fdd into main Apr 11, 2026
12 checks passed
@aviadshiber aviadshiber deleted the claude/handle-issue-202-VFSRs branch April 11, 2026 12:47
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.

3 participants