Repository navigation
Conversation
… command substitution (Graphify-Labs#1413) The opencode plugin template embedded the reminder string with backticks around `graphify query "<question>"`. Because the plugin prepends `echo "<reminder>" && <cmd>` to the user's bash command, those backticks triggered bash command substitution: every grep/rg/find invocation silently ran `graphify query "<question>"` and substituted its output ("No matching nodes found.") into the reminder text shown to the agent. This both corrupted tool output with graphify noise, and actually spawned a graphify process + loaded graph.json + ran a BFS traversal with the literal token <question> on every search. Fix: remove the backticks. Adds a guard comment in the template so future editors don't reintroduce the bug, and a regression test that asserts the reminder string contains no backticks and no $() constructs.
Member
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.
Fixes #1413.
Summary
The opencode plugin template shipped by
graphify install --platform opencodeembedded the reminder string with backticks aroundgraphify query "<question>". Because the plugin prependsecho "<reminder>" && <cmd>to the user's bash command, those backticks triggered bash command substitution — every grep/rg/find invocation silently rangraphify query "<question>"and substituted its output (No matching nodes found.) into the middle of the reminder text the agent sees.This both (a) corrupted every bash search's tool output with graphify noise, and (b) actually spawned a graphify process + loaded
graph.json+ ran a BFS traversal with the literal token<question>on every search.Root cause
graphify/__main__.pyline 1394 (v0.8.44):'echo "[graphify] knowledge graph at graphify-out/. For focused questions, run \`graphify query \\"<question>\\"\` (scoped subgraph...) " && 'The literal
`chars inside the JS string become live backticks when the JS runs inside anecho "..."shell command — bash evaluates them as command substitution.Fix
Strip the backticks from the reminder string. Plain words render fine in opencode's TUI; markdown code spans were never useful in shell echo output anyway.
Also adds a guard comment in the JS template (
// IMPORTANT: keep the reminder string free of backticks and $(...) constructs) so a future editor doesn't reintroduce the bug by accident.Verification
test_opencode_plugin_reminder_has_no_backticksparses the generated plugin'secho "..."string and asserts it contains no`and no$(. The test fails on the pre-fix code (it finds the backticks) and passes after the fix.Symptom before fix
Real session output, where bash substituted
graphify query "<question>"→No matching nodes found.:Notice
run No matching nodes found.in the middle of the sentence.Symptom after fix
Bonus
The same anti-pattern (backticks inside bash echo strings) likely exists in other skill templates. Out of scope for this PR but worth a separate audit.