MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / buildGateMessage

Function buildGateMessage

src/agent/read-ledger.ts:109–122  ·  view source on GitHub ↗
(relPath: string, kind: 'unread' | 'stale')

Source from the content-addressed store, hash-verified

107
108/** The observation the model receives when the gate refuses a mutation. */
109export function buildGateMessage(relPath: string, kind: 'unread' | 'stale'): string {
110 if (kind === 'unread') {
111 return (
112 `[ACCESS_DENIED] You attempted to modify "${relPath}" without reading it first. ` +
113 `Call read_file on this exact path, understand its current contents, then retry the edit. ` +
114 `(grep results are NOT sufficient — they show isolated lines, not the file.)`
115 );
116 }
117 return (
118 `[ACCESS_DENIED] "${relPath}" changed on disk AFTER you last read it ` +
119 `(another tool, command, or the user modified it). Your knowledge of this file is stale. ` +
120 `Call read_file on it again, then retry the edit against the current contents.`
121 );
122}

Callers 2

executeToolCallMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected