fix: include gist-instructions.md in container image and add missing K8s env vars (#202)#236
Merged
aviadshiber merged 4 commits intomainfrom Apr 11, 2026
Merged
Conversation
…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>
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.
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