PR: 55N10E/picoclaw-1#1 Fix/tool config load image reaction#2888
Conversation
|
|
c82db88 to
7e3fe16
Compare
When a gateway process exits without cleaning up the PID file (kill -9, hard crash, power loss), and the PID is reused by an unrelated process (e.g. systemd-resolved), the singleton check would incorrectly block gateway startup, causing a crash loop under systemd. The fix adds isPicoclawProcess() which reads /proc/<pid>/cmdline on Linux to verify the process name contains 'picoclaw'. If the check cannot be performed (non-Linux systems without /proc), it conservatively returns true to avoid breaking existing behavior. Changes: - pkg/pid/pidfile_unix.go: Add isPicoclawProcess() verification after signal(0) succeeds and after EPERM. Process must contain 'picoclaw' in its cmdline to be considered a running gateway instance. - pkg/pid/pidfile_windows.go: Add TODO comment for equivalent fix. - pkg/pid/pidfile_test.go: Add 3 tests for isPicoclawProcess. Fixes #2720
…safety guard The absolutePathPattern regex matches any /... sequence, which incorrectly captures path separators inside relative paths. For example, 'skills/whoami/SKILL.md' would match '/whoami/SKILL.md' starting at the internal slash, causing the workspace restriction to incorrectly block the command. Add a context check: if the character before a / match is alphanumeric, underscore, dash, dot, or slash, the / is part of a relative path and should be skipped. This preserves correct blocking of true absolute paths like /etc/passwd while allowing relative paths like skills/whoami/SKILL.md. Fixes #2749
fix(pid): verify process identity to prevent stale PID false positives
fix(shell): prevent relative paths from being treated as absolute in safety guard
…tions API OpenAI renamed the web_search_preview tool type to web_search in the Chat Completions API. Using the legacy name causes a 400 error: Invalid value: 'web_search_preview'. Supported values are: 'function' and 'custom'. This fix updates the openai_compat provider to use the current tool type name, aligning with the OpenAI Responses API which already uses web_search via the SDK. Fixes #2887 Changes: - provider.go: buildToolsList() emits "web_search" instead of "web_search_preview" - provider_test.go: updated all test assertions and comments - types.go: updated NativeSearchCapable doc comment - config.go: updated PreferNative doc comment
fix(provider): rename web_search_preview to web_search in Chat Completions API
…bled Both load_image and reaction are registered in agent_init.go via IsToolEnabled(), but neither had a case in the switch statement nor a field in ToolsConfig. This meant they always fell through to default: return true, making them impossible to disable via config. Changes: - Add LoadImage ToolConfig field to ToolsConfig struct - Add Reaction ToolConfig field to ToolsConfig struct - Add case 'load_image' and 'reaction' to IsToolEnabled switch - Set both to Enabled: true in DefaultConfig (preserving old behavior) - Add config.example.json entries for both tools - Add tools_test.go covering: - Default enabled state - Explicit disable/enable toggle - All known tools have explicit cases - Unknown tools default to enabled Fixes #2878
…eaction, and load_image tools
bac6a51 to
61c84f6
Compare
This pull request was closed.
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.
📝 Description
🗣️ Type of Change
🤖 AI Code Generation
🔗 Related Issue
📚 Technical Context (Skip for Docs)
🧪 Test Environment
📸 Evidence (Optional)
Click to view Logs/Screenshots
☑️ Checklist