Skip to content

feat(zed): add per-project attribution - #939

Open
Vlaaaaaaad wants to merge 1 commit into
getagentseal:mainfrom
Vlaaaaaaad:zed-projects
Open

feat(zed): add per-project attribution#939
Vlaaaaaaad wants to merge 1 commit into
getagentseal:mainfrom
Vlaaaaaaad:zed-projects

Conversation

@Vlaaaaaaad

Copy link
Copy Markdown

Summary

TL;DR: add best-effort per-project attribution to Zed. Proof-of-concept follow-up to #480 / #594

Warning

This code was written by LLMs, under the supervision of a so-called developer that spends more time in Pages&Keynote than in an IDE!

Zed Agent Threads can happen in 2 types of workspaces:

  • single-folder workspaces, the "classic" IDE-in-a-folder. In this case, the folder name is used as the project name, with some Zed-matching cleanup
  • multi-folder workspaces, where in the same Zed window there are multiple folders/projects opened. Think codeburn and homebrew-codeburn and agentseal in the same Zed window. In this case, the project name in Codeburn output will be agentseal, codeburn, homebrew-codeburn (folder names, sorted lexicographically)

This LLM-written, human-validated (beware: dumb human) pull request implements the above. Zed Agent Threads without folder metadata remain in the legacy catch-all zed bucket.

Testing

I tested this on one of my devices and I can confirm the single zed is split into multiple projects:

Before:

Top projects
┌───────────┬───────────┬────────────┐
│  Project  │     Cost  │  Sessions  │
├───────────┼───────────┼────────────┤
│  zed      │  $278.04  │     1,160  │
└───────────┴───────────┴────────────┘

After (keep in mind I also did a bunch of work in zed since I do have some tiny contributions to Zed):

Top projects
┌───────────────────────────────────────────────────────────────┬───────────┬────────────┐
│  Project                                                      │     Cost  │  Sessions  │
├───────────────────────────────────────────────────────────────┼───────────┼────────────┤
│  zed                                                          │  $179.82  │       373  │
│  otel-experiment                                              │   $42.91  │        88  │
│  infra                                                        │   $18.56  │        35  │
│  temp-xxx-xxxx                                                │   $13.68  │       225  │
│  Corporate                                                    │    $4.96  │       145  │
│  xxx-xxxx-xxx-github                                          │    $4.45  │         1  │
│  dotfiles                                                     │    $3.80  │        10  │
│  zed, REDACTED.txt, ALSO-REDACTED.txt                         │    $2.88  │        29  │
│  xxx-xxxx-xxx-blogs                                           │    $1.69  │         2  │
│  temp-xxx-xxxx, temp-xxxx, temp-xxxxx-xxxxxxxx, temp-xxxxxxx  │    $1.42  │        25  │
└───────────────────────────────────────────────────────────────┴───────────┴────────────┘

This was not a complex setup and I did not have a bunch of work on this machine (no ACP threads, relatively low number of sessions, minimal worktree usage, etc). More testing would be a very good idea!

Notes

Since I am not at all familiar with the codeburn codebase and patterns, this is more of a proof-of-concept than an actual PR. Please feel free to close this or just treat it as somewhat-relevant-documentation/example for a real implementation — I will not be offended in any way, shape, or form!

Relevant Zed references:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant