calva

exitsandman 2026-03-02T16:26:31.602079Z

is there a way to tell calva to treat forms the same way comment is w.r.t. the command that evals the form you're in?

pez 2026-03-02T16:37:03.960639Z

I’m assuming the way Calva treats the content of the comment form as being top-level? I.e. so that you could specify a symbol foo which would behave like:

(foo
  (a (b
      c|))
  )
Cursor at | and evaluate top level form would call a? The answer is no, but I think it should not be too hard to implement. What say you @jonurnieta? You were the last one seen wandering into this territory. 😃

exitsandman 2026-03-02T16:41:40.117419Z

I think I'll try my hand at doing it tbh

exitsandman 2026-03-02T16:42:05.749169Z

and yes, it is indeed that

pez 2026-03-02T16:49:38.284719Z

Issue welcome. > I think I’ll try my hand at doing it tbh Taking this as you want to add it to Calva? Would be awesome. Please start with an issue. It’s where we keep our problem statements.

jramosg 2026-03-02T17:36:10.594969Z

It does not seem too hard, with some config a user could add the custom comment forms

exitsandman 2026-03-02T17:39:15.392489Z

From what I see, currently the way this happens is with a hardcoded === 'comment' check. I wonder if one could have like a customCommentForms: ["foo", "bar/baz"] kind of config and replace all such checks with a lookup into it (I see there is a way to resolve aliases via an aliasMap as well, maybe that comes to play)?

jramosg 2026-03-02T17:39:26.013199Z

We could use current ns aliases config for requires

exitsandman 2026-03-02T17:47:28.036469Z

these seem to be the places that care about this:

src/extension.ts::328
src/cursor-doc/token-cursor.ts::989
src/cursor-doc/token-cursor.ts::800
src/NotebookProvider.ts::67 ; oh no
src/calva-fmt/src/format.ts::239

jramosg 2026-03-02T17:49:01.960339Z

Yes, I was talking about aliasMap. You have examples of how is used in pairs config

exitsandman 2026-03-02T17:49:12.122139Z

yeah indeed

exitsandman 2026-03-02T17:53:23.066939Z

so my plan would be: • add a new config key: customCommentForms: string[] • create an isCommentFormHead(symbol) function somewhere sensible that checks if symbol === comment , or else tries to find the symbol or the resolved alias thereof in customCommentForms • replace all checks above with isCommentFormHead

jramosg 2026-03-02T18:01:17.989609Z

Looks good to me

exitsandman 2026-03-02T18:10:34.785509Z

my only question is, does foo/bar get parsed as a token or does it get parsed as [foo, /, bar]? E: looking at the lexer I'd hazard the guess it does get parsed as a single token

jramosg 2026-03-02T18:19:15.293089Z

I think you’ll get string foo/bar

exitsandman 2026-03-02T18:19:34.517349Z

yeah that is my guess as well

jramosg 2026-03-02T18:23:13.509779Z

In pairs selection/drag you have a fn where that foo/bar is checked with aliasMap

exitsandman 2026-03-02T18:23:43.681209Z

yeah that was my clue to it

exitsandman 2026-03-02T18:45:30.001859Z

made a PR (it failed 🥀 )

michaelwhitford 2026-03-02T19:13:29.717339Z

Hey @pez I did not see a channel for backseat driver. Are you doing automatic compaction in backseat driver? I have a prompt that you might be interested in for that.

seancorfield 2026-03-02T19:25:02.847389Z

It's "just" an MCP tool that LLMs can invoke to do specific things. Does it need compaction?

michaelwhitford 2026-03-02T19:26:52.926799Z

What does it do at the end of a session when it's out of tokens? I used it for work a while ago but did not remember and I don't have github copilot access anymore.

michaelwhitford 2026-03-02T19:27:56.397039Z

I guess maybe the compaction would happen in the copilot extension not the backseat driver extension.

seancorfield 2026-03-02T19:35:32.916429Z

The compaction would need to happen at the session level -- and Copilot lets you select any model so I don't know whether there's any portable, cross-model way for it to do that automatically? FWIW, I've never run out of tokens with Copilot's $19/month business subscription but I'm only just starting to switch to the models that have a 3x cost (vs the 1x default for most of Copilot's models).

pez 2026-03-02T19:44:39.824119Z

Hi! Context compaction is outside Backseat Driver’s responsibilities, at least of current. It’s for the AI harness to care about. So #eca is very probably doing compaction. I am still curious about the prompt. 😃

pez 2026-03-02T19:45:44.224439Z

This is the channel for Backseat Driver, btw, at least for now.

michaelwhitford 2026-03-02T19:46:16.230369Z

I'm using it in eca already and it's actually insanely great, which is why I was gonna ask if you wanted to beta test it in backseat driver. @ericdallo is not a nucleus style prompt fan.

pez 2026-03-02T20:02:05.655819Z

I don’t think BD can compact context. But Copilot and other harnesses may have settings for what prompt to use for the compaction. I can check.

ericdallo 2026-03-02T20:49:58.678779Z

@michael819 yeah, the compact prompt lives in LLM client side, in this case copilot, not sure it's customizable tho (I'd say no), I think eca is one of the few tools that allow customize those internal capabilities prompts I do find awesome the prompt tunning, but my biggest concern is maintain those prompts @michael819 as usually it's not human readable

michaelwhitford 2026-03-02T20:54:44.188539Z

I am working on that part, but I have a compiler now, it's going much faster to find the optimal prompts. I just gotta figure out how to expand the lambda back to words in a way that makes sense.

ericdallo 2026-03-02T20:55:08.100289Z

Yeah that would be quite a thing