You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Wire datafusion validation into sql_execute — catches column/table errors
locally before hitting the warehouse (uses schema cache with 24h TTL)
- Add sql_pre_validation telemetry event to measure catch rate and latency
- Add apply_patch retry-with-re-read on verification failure — re-reads
the file and retries once before giving up, with actionable error messages
- Add file-not-found cache in read tool — prevents retry loops on missing
paths (capped at 500 entries)
- Add agent behavior rules to system prompt: act first/ask later, enforce
read-before-edit, limit retries to 2 per input
- Add actionable connection error guidance in warehouse_test — maps common
auth failures (wrong password, missing key, SSO timeout) to fix instructions
- Auto-pull schema cache in altimate_core_validate when no schema provided
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
// altimate_change start — auto-pull schema from cache when not provided
20
+
if(!hasSchema){
21
+
constcachedSchema=awaittryGetSchemaFromCache()
22
+
if(cachedSchema){
23
+
args={ ...args,schema_context: cachedSchema}
24
+
hasSchema=true
25
+
}
26
+
}
27
+
// altimate_change end
16
28
constnoSchema=!hasSchema
17
29
if(noSchema){
18
30
consterror=
19
-
"No schema provided. Provide schema_context or schema_path so table/column references can be resolved."
31
+
"No schema provided. Provide schema_context or schema_path so table/column references can be resolved. Tip: run schema_index first to cache your warehouse schema."
return"\n\nHow to fix: Check the password in your connection config. Verify the username has access from your current IP address. Use `warehouse_remove` then `warehouse_add` to re-enter credentials."
49
+
}
50
+
if(lower.includes("password must be a string")||lower.includes("scram")){
51
+
return"\n\nHow to fix: The password field is missing or not a string. Check your connection config — the password may be empty or set to a non-string value. Use `warehouse_remove` then `warehouse_add` to re-configure."
return"\n\nHow to fix: Key pair authentication failed. Verify: (1) the key file is PEM/PKCS#8 format, (2) the passphrase is correct, (3) the key has not expired, (4) the public key is registered in your warehouse."
return"\n\nHow to fix: No password was provided. Use `warehouse_remove` then `warehouse_add` to configure credentials. For Snowflake, you can also use key pair or SSO authentication."
return"\n\nHow to fix: SSO browser authentication timed out. Ensure your default browser opened the auth page. If running in a headless environment, switch to password or key pair authentication instead."
return"\n\nHow to fix: Cannot reach the database server. Check: (1) the hostname and port are correct, (2) the server is running, (3) any firewalls or VPNs are configured to allow the connection."
67
+
}
68
+
if(lower.includes("schema")&&(lower.includes("does not exist")||lower.includes("not authorized"))){
69
+
return"\n\nHow to fix: The specified schema does not exist or your user lacks access. Check: (1) the schema name is spelled correctly, (2) your user/role has USAGE privilege on the schema."
Copy file name to clipboardExpand all lines: packages/opencode/src/session/prompt/anthropic.txt
+19-1Lines changed: 19 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -69,9 +69,27 @@ I've found some existing telemetry code. Let me mark the first todo as in_progre
69
69
70
70
# Doing tasks
71
71
The user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:
72
-
-
72
+
-
73
73
- Use the TodoWrite tool to plan the task if required
- Start working immediately. Do NOT ask clarifying questions unless the request is genuinely ambiguous with multiple incompatible interpretations.
80
+
- If you can make a reasonable assumption, make it and state what you assumed. The user can correct you.
81
+
- Prefer taking a small action (scan the project, read a file, check the schema) over asking the user what to do.
82
+
83
+
## Always read before editing
84
+
- NEVER call edit, write, or apply_patch on a file you have not read in the current session.
85
+
- If apply_patch fails with "Failed to find expected lines", re-read the file immediately and generate a new patch from the fresh content. Do NOT retry the same patch.
86
+
- After a file_not_found error on a specific path, do NOT attempt to read that same path again. Move on or ask the user.
87
+
88
+
## Limit retries
89
+
- If a tool call fails twice on the same input, do NOT retry a third time. Instead, explain what went wrong and try an alternative approach.
90
+
- If apply_patch or edit fails on the same file twice, re-read the file, then try once more with fresh content. If that also fails, stop and report the issue.
91
+
<!-- altimate_change end -->
92
+
75
93
- Tool results and user messages may include <system-reminder> tags. <system-reminder> tags contain useful information and reminders. They are automatically added by the system, and bear no direct relation to the specific tool results or user messages in which they appear.
`apply_patch verification failed: ${retryError}\n\nThe file has been modified since you last read it. Please re-read the file and generate a new patch.`,
118
+
)
119
+
}
120
+
}else{
121
+
thrownewError(
122
+
`apply_patch verification failed: ${error}\n\nThe expected lines were not found in the file. Please re-read the file and generate a new patch based on its current contents.`,
0 commit comments