PM Agent Cannot Post Gitea Comments - Needs GITEA_TOKEN Access #76
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The PM agent cannot perform actions that require Gitea API access, such as:
This limits PM's ability to communicate with users through the Gitea hub.
Root Cause
When
kugetsu delegatespawns an opencode session for the PM agent, it does not pass theGITEA_TOKENenvironment variable. The PM agent has no way to authenticate with Gitea's API.What Was Tried
Attempt 1: Direct curl from Hermes
Ran curl directly from Hermes to post a comment, but this doesn't show as PM agent activity in audit logs.
Attempt 2: Passing task via /tmp file
Tried to write a task file to
/tmp/for PM to read, but opencode'sexternal_directorypermission blocks/tmp/*access in headless mode.Attempt 3: Passing task via ~/.kugetsu/
Tried to write task file to
~/.kugetsu/but Hermes blocked the write operation.Attempt 4: Embedding message in delegation command
Tried embedding the message directly in the shell command, but shell quoting issues with special characters broke the command.
Attempt 5: PoC - Pass GITEA_TOKEN to opencode session
Success. Modified
kugetsu delegateto exportGITEA_TOKENbefore running opencode:PM agent successfully posted a comment to PR #69 using the Gitea API.
Proper Implementation Plan
1. Token Storage
~/.kugetsu/configinstead of hardcoding:kugetsu init, prompt user for Gitea token if not found~/.git-credentials2. Config Loading
kugetsuto source~/.kugetsu/config(like bash profile)GITEA_TOKENfrom config when running opencode commands3. Fallback Behavior
https://user:token@git.example.com4. Security Considerations
passor similar secret storage in futureFiles to Modify
~/.kugetsu/configGITEA_TOKEN=line~/.local/bin/kugetsudocs/kugetsu-setup.mdRelated Issues
/tmp/*Permission Blocking Subagent Workflows (related/tmppermission issue)Generic Credential/Data Pass-Through Proposal
The issue is about passing
GITEA_TOKENto the PM agent, but lets think about a generic mechanism for passing credentials and data to agents during delegation.Current Problem
cmd_delegatespawns:No environment variables or context data are passed to the agent. The agent cannot:
Proposed Solution:
~/.kugetsu/env+kugetsu envcommand1. Environment file (
~/.kugetsu/env):2.
kugetsu envcommand:3. Modified
cmd_delegate:4. Alternative: Per-session env files
Benefits
Questions
~/.kugetsu/envor a different filename?wow I like the idea of per-session command. but I think we can make it simpler by per agent command, what do you think? for example we can have config that used by all agents. but if its specifically using pm-agent, then we will use config from pm-agent and it will override the default config for all agent. what do you think? also what do you think of using specific env file compared to using config json?
yes, env vars should be masked in logs for security.