Live data from Hacker News

LLM=True

blog.codemine.be

121–130 of 155 posts

Re: LLM=True

#121

Many unix tools already print less logging when used im a script, ie. non-interactively. (I don't know how they detect that.) For example, `ls` has formatting/coloring and `ls | cat` does not. This solution seems like it would fit the problem from the article?

There’s a function isatty that detect if a file descriptor (stdout is one) is associated with a terminal

https://man.openbsd.org/man3/ttyname.3

I believe most standard libraries has a version.

Re: LLM=True

#122
post #98

All of this because we only have stdout and stderr and nothing in between. I wish there was a stdlog or stddebug or something

yes, if only we had a more fine-grained log level hierarchy that we could get every piece of software to agree to...

Re: LLM=True

#123

Earlier quoted context omitted.

That's a good call. It's a big problem for JSON configs given pure JSON's strict no-comments policy. I like tools that let you use .js or better yet .ts files for config.

A lot of json parsers will permit comments even though it isn't meant to be valid. Worth trying it, see if a comment breaks the config, and if not then use comments and don't worry about it.

For reference, jq and python don't allow comments.

Re: LLM=True

#124

Many unix tools already print less logging when used im a script, ie. non-interactively. (I don't know how they detect that.) For example, `ls` has formatting/coloring and `ls | cat` does not. This solution seems like it would fit the problem from the article?

There’s a function isatty that detect if a file descriptor (stdout is one) is associated with a terminal https://man.openbsd.org/man3/ttyname.3 I believe most standard libraries has a version.

I was about to comment the same thing. Usually I don't call the function directly, but via the tty command in my shell scripts:

  if tty -s; then
    echo "Standard input is a TTY (interactive mode)."
  else
    echo "Standard input is not a TTY (e.g., piped or redirected)."
  fi
Now I wonder how _isatty_ itself detects whether a file descriptor is associated with a terminal!

Re: LLM=True

#125
post #120

> The environment wins (less tokens burned = less energy consumed) This is understandable logic, but at a systemic level it's not how things always go. Increasing efficiency can lead to increased consumption overall. You might save 50% in energy for your workload, but maybe now you can run it 3 times as much, or maybe 3 times more people will use it, because it's cheaper. The result might be a 50% INCREASE in energy…

Yeah, probably. I wonder where speed-running fixing all the low-hanging fruit for AI-related efficiency improvements will leave us? It still seems worth doing. Maybe combined with a carbon tax.

Re: LLM=True

#126

Many unix tools already print less logging when used im a script, ie. non-interactively. (I don't know how they detect that.) For example, `ls` has formatting/coloring and `ls | cat` does not. This solution seems like it would fit the problem from the article?

> I don't know how they detect that.

The OS knows (it has to because it set up the pipeline), and the process can find out through a system call, exposed in C as `isatty`: https://www.man7.org/linux/man-pages/man3/isatty.3.html

> This solution seems like it would fit the problem from the article?

Might not be a great idea. The world is probably already full of build tools pipelines that expect to process the normal terminal output (maybe with colours stripped). Environment variables like `CI` are a thing for a reason.

Re: LLM=True

#127
Why can't the agent harness dynamically decide whether outputs should be put into the context or not? It could check with an LLM to determine if the verbatim output seems important, and if not, store the full output locally but replace it in the prompt with a brief summary and unique ID. Then make a tool available so the full output can be retrieved later if necessary. That's roughly how humans do it, you scroll through your terminal and make quick decisions about what parts you can ignore, and then maybe come back later when you realize "oh I should probably read that whole stack trace".

It wouldn't even need to send the full output to make a decision, it could just send "npm run build output 500 lines and succeeded, do we need to read the output?" and based on the rest of the conversation the LLM can respond yes or no.

Re: LLM=True

#128
post #54

> Then a brick hits you in the face when it dawns on you that all of our tools are dumping crazy amounts of non-relevant context into stdout thereby polluting your context windows. I've found that letting the agent write its own optimized script for dealing with some things can really help with this. Claude is now forbidden from using `gradlew` directly, and can only use a helper script we made. It clears, recompiles…

How is it forbidden? I tell agents to use my wrappers in AGENTS but they ignore it half the time and use the naked tool.

Re: LLM=True

#129

Why can't the agent harness dynamically decide whether outputs should be put into the context or not? It could check with an LLM to determine if the verbatim output seems important, and if not, store the full output locally but replace it in the prompt with a brief summary and unique ID. Then make a tool available so the full output can be retrieved later if necessary. That's roughly how humans do it, you scroll thro…

Isn't that what subagents do to a certain degree?

Re: LLM=True

#130
post #129

Why can't the agent harness dynamically decide whether outputs should be put into the context or not? It could check with an LLM to determine if the verbatim output seems important, and if not, store the full output locally but replace it in the prompt with a brief summary and unique ID. Then make a tool available so the full output can be retrieved later if necessary. That's roughly how humans do it, you scroll thro…

Isn't that what subagents do to a certain degree?

Sort of, but you also want to keep the sub-agent context small for as long as possible, and if you're paying per token there's no reason to be sending thousands of tokens that are probably useless.
Post reply on HN