[Bug]: TypeScript masking re-resolves already exported secret getters
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- backend
Research direction
Read clients/typescript/src/conversation/secret-registry.ts, especially the maskSecretsInOutput() loop and its cached-key guard. Use the existing TypeScript registry test harness to cover repeated masking of an exported getter, explicit export refresh, and uncached callable resolution. Done means cached getters are not called during masking, while the stated masking and refresh behavior remains covered.
Written by the indexing model from the issue text.
Description
Correction after triage
The original rotation report described the Python SDK's deliberate last-resolved-value masking contract. I am retaining that behavior and narrowing this report to an unnecessary getter call in the TypeScript mirror. No cross-SDK rotation-policy change is proposed.
Problem
At 4cc058275c5a08d845bd846576aafc80e5dd7d0d, maskSecretsInOutput() calls source.getValue() before checking !this.exportedValues.has(key). An already exported callable is therefore invoked on every masking call, although its new value is discarded and the cached exported value is used.
The TypeScript loop and Python cache guard differ here. Python skips a cached source before resolving it. LocalConversation.maskSecrets() directly delegates to the TypeScript method.
Reproduction
Using the existing TypeScript registry test harness:
const registry = new SecretRegistry();
let calls = 0;
registry.updateSecrets({ TOKEN: () => { calls++; return 'cached-token'; } });
registry.getSecretsAsEnvVars('$TOKEN');
registry.maskSecretsInOutput('cached-token');
registry.maskSecretsInOutput('cached-token');
expect(calls).toBe(1);
The identical regression test fails on the unchanged base with expected 3 to be 1; the other 24 focused cases pass. Moving the existing cached-key guard before getValue() makes all 25 focused cases pass. The test also checks that an explicit subsequent export resolves the getter again, refreshes the cache, and still masks the newly exported value. A separate case preserves uncached callable resolution. No model or remote service was called.
Intended scope
Skip resolution only for keys that already have an exported cached value. Preserve current masking results, explicit export refresh, uncached resolution, failure handling and replacement order. This is not a claim of full Python parity: TypeScript's uncached-success caching and retry backoff remain separate concerns.
I will wait for readiness triage before opening a PR. The previous rotation proposal is retained locally as research and will not be submitted.
Analysis, regression and proposed fix were prepared with assistance from OpenAI Codex.
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 797
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 354
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenHands/software-agent-sdk
-
[Bug]: `list_directory` reports a complete listing as truncated when a directory has exactly 500 entriesPossibly taken @balabommablock-cpu claimed this 29 days ago. Openbug priority:low ready-for-dev
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
OpenHands/software-agent-sdk#6133 ·
Maintainers usually reply within 1 day
-
[Bug]: Command hook that exits 1 is treated as blocking when its stdout is a JSON `deny` or `continue: false`Possibly taken A pull request linked to this issue is open or already merged. Openbug priority:low ready-for-dev
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenHands/software-agent-sdk#6116 · 3 comments ·
Maintainers usually reply within 1 day
-
[Bug]: TypeScript GET-with-body requests remain pending after a truncated responsePossibly taken @BlueRaddish claimed this 34 days ago. Openbug priority:low ready-for-dev
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
OpenHands/software-agent-sdk#6059 ·
Maintainers usually reply within 1 day
-
[Bug]: Document whether `prompt_tokens` includes `cache_read_tokens` in accumulated token usagePossibly taken @Jaxon1216 claimed this 36 days ago. Openpriority:low ready-for-dev
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
OpenHands/software-agent-sdk#5975 ·
Maintainers usually reply within 1 day
-
[Bug] Unauthenticated model-info lookup still emits GET /v1/model/info when key is NonePossibly taken @daviskay75 claimed this 49 days ago. Openpriority:low
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
OpenHands/software-agent-sdk#5454 · 3 comments ·
Maintainers usually reply within 1 day
All issues in OpenHands/software-agent-sdk
Similar issues
-
[Bug]: reme CLI crashes when the running server used a relative config pathPossibly taken @nurlanmnn claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
agentscope-ai/ReMe#770 ·
Maintainers usually reply within 1 day
-
Pi: paused model calls are reported as "not signed in" when the model's provider comes from an extensionPossibly taken @balcsida claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
microsoft/TokenEconomizer#288 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 67/100
sickn33/agentic-awesome-skills#2437 ·
Maintainers usually reply within 1 day
-
site-bug triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ethereum/consensus-specs#5846 ·
Maintainers usually reply within 1 day