fix: surface dynamic_context in Agent Tools & Metadata modal (#932)#973
Open
burakkeless wants to merge 1 commit into
Open
Conversation
…ds#932) The backend SystemPromptEvent carries three content fields (system_prompt, tools, dynamic_context), but the frontend only read the first two. dynamic_context (datetime, skills catalog, runtime services, custom secrets) is part of the system message the model actually receives and is larger than the static prompt, so the modal showed less than half of the agent's true context. - Add optional dynamic_context to the SystemPromptEvent interface - Surface it via adaptSystemMessage and a new "Dynamic Context" tab - Defensively redact unmasked <CUSTOM_SECRETS> values client-side - Reset to the System tab on open so a now-hidden tab can't leave an empty panel - Add tests and translations for all locales Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Someone is attempting to deploy a commit to the openhands Team on Vercel. A member of the Team first needs to authorize it. |
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.
Summary
Closes #932.
The "Agent Tools & Metadata" modal rendered only
system_prompt.textandtoolsfrom the backendSystemPromptEvent. That event actually carries a third content field,dynamic_context, which was never referenced in the frontend (nor in theSystemPromptEventTS interface).dynamic_contextis part of the system message the model actually receives — and it's larger than the static prompt (≈17.2k vs ≈14.4k chars in a real event). It holds the runtime-injected sections:<CURRENT_DATETIME>,<SKILLS>,<RUNTIME_SERVICES>, and<CUSTOM_SECRETS>. As a result the modal showed less than half of the agent's true system context.Changes
dynamic_context?: TextContentto theSystemPromptEventinterface (optional, so older persisted events stay valid).adaptSystemMessagenow surfacesdynamicContextonSystemMessageForModal.redactCustomSecretsbackstop that re-masks any unmasked value inside a<CUSTOM_SECRETS>block (KEY=value/KEY: value, tolerant of a truncated block) before display.SYSTEM_MESSAGE_MODAL$DYNAMIC_CONTEXT_TABadded for all locales.Testing
redact-custom-secrets.test.ts(new): both separators, multiple secrets, truncated block, idempotency, leaves text outside the block untouched.system-message-adapter.test.ts: dynamic_context absent →null; present → surfaced; unmasked secret → redacted.npm run typecheckand the targeted vitest files pass locally (13 tests).