nextlevelbuilder / nextlevelbuilder/goclaw
Bug report: Master system cannot edit predefined context files for newly created agent
Open
Nobody has claimed this yet.
agent-settings
agent:github-maintain
area:security
bug
maintain:triaged
P2-medium
- Dominant language
- Go
- Stars
- 3.6k
- Forks
- 1.1k
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 24
Description
Steps
- Log in to GoClaw Web UI as
system (Master). - Open agent
Fxxx:- Agent ID:
019dc854-xxxx-7ef7-xxxx-64bd4156xxxx - Agent key:
fxxx - Agent type:
predefined - Owner ID currently shown by API:
18xxxxxxxx
- Agent ID:
- Open the agent Files tab.
- Select predefined context files such as
AGENTS.md,SOUL.md,IDENTITY.md,USER_PREDEFINED.md, orCAPABILITIES.md. - Try to edit/save the file.
- Optionally attempt to update ownership through public API:
PUT /v1/agents/{id}with{ "owner_id": "system" }- API returns
{"ok":"true"}, butGET /v1/agents/{id}still showsowner_id: "18xxxxxxxx".
Expected
- A
Master/ gateway owner-level account should be able to administer and edit predefined agent context files, especially for an agent created/managed in the same system. - If ownership transfer is unsupported through
PUT /v1/agents/{id}, the API should rejectowner_idwith a clear validation error instead of returning success. - There should be a documented, supported path to transfer ownership or allow system-level admin override.
Actual
- The Files tab is read-only and displays:
Read-only — Only the agent owner can edit predefined context files.
system (Master)is treated as non-owner for predefined context file editing.- Sharing/admin role labels do not help because role-based permissions are documented as stored but not enforced.
PUT /v1/agents/{id}accepts anowner_idpayload and returns OK, but the owner is not changed.
Impact
- System administrators cannot fix or maintain predefined agent context files from the Master account.
- Newly created predefined agents can become effectively locked if the recorded
owner_idcannot log in or does not map cleanly to the current Web UI identity. - This creates a mismatch between admin expectations and actual permissions.
- The API success response for ignored
owner_idupdates can mislead operators and automation.
Proposed fix
- Permission fix:
- Allow gateway owner-level / Master users to edit predefined agent context files, or
- Add a documented ownership transfer endpoint, e.g.
POST /v1/agents/{id}/transfer-owner.
- API contract fix:
- If
owner_idis immutable viaPUT /v1/agents/{id}, return400 Bad Requestor422 Unprocessable Entitywhen clients sendowner_id. - Alternatively, support
owner_idupdates explicitly with proper authorization and audit logging.
- If
- UI fix:
- Update the read-only logic/message to distinguish:
- true non-owner users
- shared users
- Master/admin users
- If Master override is allowed, show the editor instead of read-only mode.
- Update the read-only logic/message to distinguish:
Contributor 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.
Research direction
Start with the Files tab logic that displays the read-only message and the PUT /v1/agents/{id} endpoint. Trace how Master users, agent owners, and owner_id updates are authorized and represented. Done means the supported permission or ownership behavior is consistent in the UI and API, with rejected unsupported updates reported clearly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, authorization, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100