Commit d906314
fix: only use finalization prompt when plan was actually executed
Corrected finalization logic:
❌ Previous (wrong):
- Used finalization prompt for direct queries (no execution)
- Normal query path had no finalization
✅ Now (correct):
- Direct queries (no execution) → normal AI response
- Tool execution results → finalization with ownPlan:true
Logic flow:
1. If no tools executed → query_with_debug() for normal response
2. If tools executed → query_osvm_ai_with_options() with:
- Finalization system prompt
- ownPlan: true (prevents server from executing)
- Formatted execution results to finalize
This ensures finalization ONLY happens after plan execution,
not for regular conversational queries.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 57ef717 commit d906314
1 file changed
+22
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
868 | 868 | | |
869 | 869 | | |
870 | 870 | | |
871 | | - | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
872 | 885 | | |
873 | 886 | | |
874 | | - | |
875 | | - | |
| 887 | + | |
| 888 | + | |
876 | 889 | | |
877 | 890 | | |
878 | 891 | | |
879 | 892 | | |
880 | | - | |
881 | | - | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
882 | 896 | | |
883 | 897 | | |
884 | 898 | | |
| |||
893 | 907 | | |
894 | 908 | | |
895 | 909 | | |
896 | | - | |
897 | | - | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
898 | 913 | | |
899 | 914 | | |
900 | | - | |
901 | | - | |
902 | | - | |
903 | | - | |
904 | 915 | | |
905 | 916 | | |
906 | 917 | | |
| |||
0 commit comments