Repository navigation
Conversation
c85286c to
cdf63f7
Compare
Greptile SummaryThis PR adds a read-only Confidence Score: 5/5Safe to merge; the fix is well-scoped, runtime token resolution is unchanged, and tests cover the primary scenario. Only one P2 edge-case finding remains: the botTokenSource/botTokenStatus priority when a configured_unavailable SecretRef coexists with an env token. This scenario (both sources simultaneously present) is uncommon in practice, and the primary crash fix is correct and well-tested. extensions/mattermost/src/mattermost/accounts.ts — the env-token vs SecretRef priority order in inspectMattermostAccount's source/status derivation. Prompt To Fix All With AIThis is a comment left during a code review.
Path: extensions/mattermost/src/mattermost/accounts.ts
Line: 185-198
Comment:
When a config-level SecretRef is `configured_unavailable` **and** an env token is also present, `botTokenSource` is forced to `"config"` and `botTokenStatus` is forced to `"configured_unavailable"` even though `botToken` is actually set to the live `envToken`. This means `probeAccount` (which reads `account.botToken`) would probe with the env token while the snapshot reports the account as credential-unavailable — a misleading inconsistency. The env-fallback branch should be evaluated before the SecretRef status takes precedence in both the source and status chains.
```suggestion
const botTokenSource: MattermostTokenSource = tokenInspection.botToken
? "config"
: envToken
? "env"
: tokenInspection.botTokenStatus === "configured_unavailable"
? "config"
: "none";
const botTokenStatus: MattermostCredentialStatus = tokenInspection.botToken
? "available"
: envToken
? "available"
: tokenInspection.botTokenStatus === "configured_unavailable"
? "configured_unavailable"
: "missing";
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(mattermost): keep status read-only f..." | Re-trigger Greptile |
cdf63f7 to
40bbc37
Compare
40bbc37 to
88e624c
Compare
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
|
Thanks for the contribution. This PR still needs the requested real-behavior proof, and the branch has been idle since that ask. Close this stale external PR: its focused SecretRef-status idea is plausible, but the branch has been inactive since April 24, 2026, is currently dirty against So I’m closing this for now to keep the review queue honest. Please reopen or open a fresh PR with real-behavior proof (a live run, logs, or a reproducible validation transcript) and it will be reviewed again. Review detailsBest possible solution: Keep the current generic degraded-read-only SecretRef behavior; if a Mattermost-specific gap still reproduces, open a fresh, rebased narrow PR with a regression test and redacted terminal proof from Do we have a high-confidence way to reproduce the issue? Yes, from source and the reported configuration: an unresolved Mattermost Is this the best way to solve the issue? No for this branch as it stands: its April implementation is dirty against current Security review: Security review cleared: The proposed diff is limited to read-only credential inspection and status metadata; it adds no execution, network, dependency, permission, or secret-exposure path. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 99046179a8fe. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper applied the proposed close for this PR.
|
Summary
openclaw statustext mode crashed when MattermostbotTokenused an unresolvedexec:keychainSecretRef.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
inspectAccountpath. Status rendering fell back toresolveAccount, which throws on unresolved SecretRefs.Regression Test Plan (if applicable)
extensions/mattermost/src/mattermost/accounts.test.tsextensions/mattermost/src/channel-actions-setup-status.contract.test.tsUser-visible / Behavior Changes
openclaw statusno longer crashes for Mattermost accounts whose bot token is configured as an unresolved SecretRef. It reports degraded credential availability instead.Diagram (if applicable)
Security Impact (required)
No)Yes)No)No)No)Yes, explain risk + mitigation: Read-only status now detects configured SecretRefs without resolving them. It does not expose token values, and runtime resolution remains strict.Repro + Verification
Environment
channels.mattermost.botTokenasexec:keychainSecretRef plusbaseUrlSteps
botTokenas an unresolved SecretRef.openclaw status.Expected
Actual
Evidence
Validation:
pnpm test extensions/mattermost/src/mattermost/accounts.test.ts extensions/mattermost/src/channel-actions-setup-status.contract.test.tspnpm check:changedHuman Verification (required)
botTokenStatus: configured_unavailable.resolveMattermostAccountstill throws on unresolved SecretRefs.exec:keychainsecret provider returning a token.Review Conversations
Compatibility / Migration
Yes)No)No)Risks and Mitigations