FIRE-1896 | gemini-cli agent-ids support - #35
Draft
yuval-qf wants to merge 1 commit into
Draft
Conversation
…nt-id A Gemini subagent's own hook events are shape-identical to the main agent's: createBaseInput emits only session_id / transcript_path / cwd / hook_event_name / timestamp, and none of them names the delegation that is running. Its tool calls therefore persisted with no attribution at all, while only the delegation report carried a name. Gemini's own transcript records do name it, and the rule is bookkeeping rather than timing: a delegation appears in the per-session subagent directory when it STARTS and in the parent transcript when it ENDS, so started-minus-finished is what is running. The remaining UUID is the subagent's session id, which is also the vendor agentId upstream stamps on the completed invoke_agent record, so it is a real per-instance id rather than a slug two concurrent runs would share. No timestamp of any kind is read or compared. An earlier design selected the live delegation by mtime, which would have made correctness depend on filesystem timestamp resolution. The POSTed body stays byte-for-byte the bytes read from stdin. The payload is parsed into a local for inspection only; everything derived travels as a header, and the tests assert body identity against the raw inbound bytes on every attribution case. Sends only the id. The agent name is already inside the relayed bytes on the one event that has one, and the backend reads it from there. Every failure path yields no header, never a wrong id: concurrent delegations, a missing directory, an unreadable or oversized parent, a delegation recorded without an agentId (matched by its prompt instead), or an id that would not be header-safe. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
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.
…nt-id
A Gemini subagent's own hook events are shape-identical to the main agent's: createBaseInput emits only session_id / transcript_path / cwd / hook_event_name / timestamp, and none of them names the delegation that is running. Its tool calls therefore persisted with no attribution at all, while only the delegation report carried a name.
Gemini's own transcript records do name it, and the rule is bookkeeping rather than timing: a delegation appears in the per-session subagent directory when it STARTS and in the parent transcript when it ENDS, so started-minus-finished is what is running. The remaining UUID is the subagent's session id, which is also the vendor agentId upstream stamps on the completed invoke_agent record, so it is a real per-instance id rather than a slug two concurrent runs would share.
No timestamp of any kind is read or compared. An earlier design selected the live delegation by mtime, which would have made correctness depend on filesystem timestamp resolution.
The POSTed body stays byte-for-byte the bytes read from stdin. The payload is parsed into a local for inspection only; everything derived travels as a header, and the tests assert body identity against the raw inbound bytes on every attribution case.
Sends only the id. The agent name is already inside the relayed bytes on the one event that has one, and the backend reads it from there.
Every failure path yields no header, never a wrong id: concurrent delegations, a missing directory, an unreadable or oversized parent, a delegation recorded without an agentId (matched by its prompt instead), or an id that would not be header-safe.