Repository navigation
feat: redact known credential values from tool output sent to the model - #1821
anandgupta42 wants to merge 9 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c3266ccc27
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const connections = Instance.restore(instance, () => Connections.knownCredentialConfigs()) | ||
| for (const connection of connections) addConnectionFields(connection, add) |
There was a problem hiding this comment.
Resolve credential configs using the supplied instance
When the caller carries its project only through InstanceRef, as the HTTP API instance-context middleware does, this restore does not cover the credential lookup: knownCredentialConfigs() is a generator, so its body runs during the subsequent iteration, after Instance.restore() has exited. Its projectRoot() then falls back to the server's working directory instead of the requested project. Consequently, project-local and in-memory warehouse credentials are omitted from the redactor, allowing tool results containing those secrets to reach session storage and the model unmasked. Pass the instance directory explicitly into the lookup rather than relying on ambient context around generator creation.
AGENTS.md reference: packages/opencode/AGENTS.md:L144-L144
Useful? React with 👍 / 👎.
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Issue for this PR
No tracking issue.
Type of change
What does this PR do?
Filter exact matches for known credential values in shell, file, search, and MCP tool output before delivery or session storage. Preserve ordinary final output and structured field names. Live shell previews hold a trailing window sized for known credential values and their encoded forms.
How did you verify your code works?
a30defc220b1524ae618f21d15ce8a4e9821424dand31078cca44599608712b708f9b91f7c61041dd31. Follow-up fixes were verified atb055428b6b8477d11498e18da730a7be64926c05.Cost side effects
None.
Screenshots / recordings
No UI changes.
Checklist