andrewmusselman opened a new issue, #26:
URL: https://github.com/apache/tooling-gofannon/issues/26

   ### Summary
   Agents have tunable knobs (e.g., `GITHUB_PUSH_CONCURRENCY` in the ASVS 
pipeline, `OPUS_CONCURRENCY` per-agent) that today have to be hardcoded into 
agent code, threaded through `inputText` as JSON, or set at the host level 
(which couples agents to the deployment environment invisibly). None of those 
is correct.
    
   ### Details
   **Problem:**
   - Hardcoding loses tunability without code edits.
   - Threading through `inputText` mixes ephemeral inputs with persistent 
configuration.
   - Host-level env vars apply to every agent — no way to vary by agent without 
coupling.
   ### Proposed solution
   **Two halves:**
    
   1. **Editor accordion + persistence.** New `EnvVarsAccordion.jsx` between 
Data Store Configuration and Agent Code in the agent editor. Three columns: Key 
/ Value / Description. POSIX-style key validation. Persists as `env_vars: 
List[AgentEnvVar]` on the Agent model.
   2. **Runtime injection via contextvar-bound environ proxy.** Mutating 
`os.environ` directly under a lock would serialize all agent runs. Instead 
install an `_EnvironProxy` wrapping `os.environ` that consults a contextvar for 
the per-task overlay. Each run sets the contextvar before invoking the agent 
function. asyncio tasks inherit contextvar context, so concurrent runs see 
different overlays without locking.
   **What this is NOT.**
   Not for secrets — values are plaintext on the agent doc and visible in trace 
events. The user-profile API Keys feature handles secrets.
    
   ### Acceptance Criteria
   - [ ] Fixed: `AgentEnvVar` model added with key/value/description fields
   - [ ] Fixed: `env_vars: List[AgentEnvVar]` field added to Agent model
   - [ ] Fixed: `_EnvironProxy` overlays per-task env via contextvar (no 
os.environ mutation)
   - [ ] Fixed: `EnvVarsAccordion.jsx` component in agent editor
   - [ ] Fixed: POSIX-style key validation client + server
   - [ ] Test added: Concurrent runs see different env-var overlays (no leakage)
   - [ ] Test added: `os.environ.get("KEY")` from agent code returns per-agent 
value
   - [ ] Test added: Empty env_vars list behaves as today
   - [ ] Documentation: editor UI screenshot, warning about plaintext storage
   ### References
   - File: `webapp/packages/api/user-service/models/agent.py`
   - File: `webapp/packages/webui/src/pages/EditAgent/`
   - Tracker: FIXES.md item #7
   ### Priority
   **Medium** - Independent feature, ~120 LOC backend + ~280 LOC frontend + ~80 
LOC tests. UI without runtime is misleading (saves values, agents don't see 
them) — ship both halves together.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to