Skip to content

Conversation

@conornash
Copy link

No description provided.

Copy link

@gojun077 gojun077 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, Conor - in your proposed changes, you are changing the default model and the default API;

I haven't used openrouter before, but I think it uses the OpenAI chat completions API format; isn't this different from the API format used by api.anthropic.com?

Also, to use openrouter.ai you must have an openrouter.ai account; I don't think it's a fair assumption that ALL users of efrit across the Internets will have openrouter.ai accounts.

Just my 2 cents as a drive-by reviewer of a drive-by PR

@conornash
Copy link
Author

Hey @gojun077 thanks for reaching out. I am definitely changing the default model here - it's totally contrary to what current users of efrit would expect!

I didn't expect anyone to comment on the very first commit which, by my own admission, doesn't work at all. I was hoping the 'draft' tag on this would have indicated that it was not ready for prime time 😄

I haven't used openrouter before, but I think it uses the OpenAI chat completions API format; isn't this different from the API format used by api.anthropic.com?

Yes, Openrouter is compatible with the OpenAI API format. Additionally, it is compatible with the endpoints that OpenAI uses, so in that way at least it is more compatible than Anthropic (which uses v1/chat/messages instead of v1/chat/completions).

I am still experimenting with what I would like this PR to be. However, I would politely recommend you to take a look at OpenRouter. It allows you to use all Anthropic models (which efrit currently uses) and over 100 other models too.

@conornash
Copy link
Author

Ok, all tests are passing and I'm able to get it working with Openrouter anthropic/claude-sonnet-4. Obviously, this stomps all over the existing implementation so I'm leaving it as a draft for now. I can see that there is at least the beginnings of a modular backend with

(defcustom efrit-agent-backend "claude-3.5-sonnet"
but it still looks like a lot of work to implement.

I've reached the goal of bootstrapping it to work on itself, which feels pretty good for today. Happy to see if anyone else can use it and add functionality/refactor it.

@conornash
Copy link
Author

FYI the tests didn't cover agent workflows, so that is not working right now.

steveyegge added a commit that referenced this pull request Nov 27, 2025
Two bugs fixed in dogfood run #7:

1. ef-i9h: efrit-do--extract-fields created alists with string keys,
   but tool functions used alist-get with symbol keys. Fixed by
   converting string keys to symbols using intern.

2. ef-yj0: efrit-do used one-shot execution (single API call) instead
   of proper agentic loop. Fixed by making efrit-do call efrit-execute
   from efrit-executor.el, which has the proper while loop that
   continues until stop_reason is "end_turn".

Before: efrit-do would call todo_write once and return immediately
After: efrit-do properly continues the conversation, executing
       multiple tool calls until Claude completes the task

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
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.

2 participants