feat(telemetry): place a turn by putting Discord's identifiers on its span #342
No reviewers
Labels
No labels
move-to-repo
coilyco-bridge-deploy
move-to-repo
coilyco-flight-deck-agent-compose
move-to-repo
coilyco-gaming-eco-app
move-to-repo
coilysiren-inbox
move-to-repo
unknown
🔒⚠️📦⚠️🔒 SANDBOXED 🔒⚠️📦⚠️🔒
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
c#
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
role/ai
role/creator
role/design
role/director
role/engineer
role/exec
role/human
role/ops
role/qa
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-gaming/sirens-echo!342
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/discord-identifiers-on-the-turn-span"
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?
closes #337
A trace id is only worth handing a member if the turn it names can be found. The turn span now carries the author's account id, the guild, the channel, the thread when there is one, and the member's message id — under the same keys the send span already used, so one query returns both halves of an exchange rather than two shapes joined by hand.
The one part that is not mechanical
Discord models a thread as a channel. The obvious mapping reports the thread id as
discord.channel.id, and every thread turn then vanishes from a query for the channel it hangs under — which is the query an operator actually runs. So the parent is reported as the channel and the thread gets its own key.Resolution reads cached gateway state and never calls the Discord API. An unresolved channel reports itself as a channel, which is what it is, and contributes no thread id. Absent beats blank.
The account id is a reversal, and should be read as one
The code said, in a comment beside this exact span, that the requester was deliberately not a span attribute because an account id is not operational telemetry. That was a real position, not an oversight.
It was overturned on purpose, by the director, in the issue. The reasoning that changed: an account id in a private telemetry backend and a handle in a public reply are different objects, and the job-record indirection that stood in for it does not cover a turn that failed before a job existed.
Both statements of the old position — the code comment and the
AGENTS.mdsafety sentence — are corrected here rather than left contradicting the code.What did not move
Prompt, model, tool, and reply bodies stay out. Nothing member-visible goes in: no display name, no nickname, no handle. A direct message contributes nothing at all, because a DM never enters the turn logger and this is not the change that should be its first exception. The HTTP turn does not implement the interface, and a test holds it to that.
Worth knowing, filed separately
ward exec gatereported PASS on this tree while a new untracked file carried a comment violation. Pre-commit only saw it once it was staged. That is the same class of surprise as #305.ward exec gategreen: build, policy-check, vet, test, test-skips, pre-commit.