Repository navigation
feat: forward prompts to Gortex for task-relevant symbol hints - #56
Merged
Merged
Conversation
Each prompt typed while Pi is idle goes to gortex hook as a prompt event, captured on input so skills and templates arrive as typed and Gortex's slash-command skip applies. The hints in the reply are appended after the prompt as a hidden gortex message, merged with the briefing on the first turn. They are never edited later, which keeps the provider's prompt cache intact. Mid-run steering and follow-up messages, sessions without graph tools, and empty or failed replies add nothing. Closes #43
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
Each prompt typed while Pi is idle now goes to
gortex hook --agent=pias apromptevent. The symbols Gortex finds relevant are attached to the turn as a hiddengortexmessage, as Claude Code'sUserPromptSubmithook does.input(src/index.ts): the prompt is captured on Pi'sinputevent, before skill or template expansion, and sent withcwdandsession_id./skill:name argstherefore reaches Gortex as typed, and its existing/prefix check skips it. Claude Code's hook gets the same raw line. The call starts oninput, so the probe runs alongside expansion and, on the first turn, alongside the readiness barrier.before_agent_start: the reply'sadditional_contextis appended after the prompt.details.briefingkeeps its meaning, so resending the briefing after compaction is unchanged.before_agent_start;src/hook.ts):PiEnvelopegainsprompt.docs/architecture.md(Orientation injection) on the append-only rule.No Gortex change is needed:
bridgePromptalready answers thepromptslot.Known limit, upstream: Gortex's prompt search only returns hits for prompts close to a symbol name (
callHook). A sentence such as "where is waitForGortexTools handled" comes back empty, on Claude Code's path as well.Reproduction
Real Pi 1.3.0 loading this checkout (
pi --no-extensions -e builtin:mcp -e ./index.ts), against a live gortex v0.64.8 daemon, with four prompts continued on one session:waitForGortexTools - reply with just the word OK, use no toolscallHookcallHook/skill:nonexistent callHookwaitForGortexToolswaitForGortexToolsEach turn read the whole previous conversation from cache.
Closes #43
Testing
npm run checkpasses (190 tests)ExtensionRunner(seedocs/tests.md):test/prompt.test.tscovers:session_idandcwdon the envelope;/skill:sent unexpanded;steerandfollowUpinput;inputevents and has aprompt()helper. The hook double can answer per envelope event.pi -e /path/to/checkout), Pi 1.3.0 on Linux against a live gortex daemon: every row of the table above. The briefing still arrives on the first turn.Checklist
docs/architecture.mdupdated briefly, only if a design decision changed: prompt hints are append-only and sent before skill expansioncallHookseam and only adds an envelope field. The windows-latest CI job runs the new suite.